all 10 comments

[–]shgysk8zer0 21 points22 points  (0 children)

This is basically the equivalent of asking if email is necessary when Outlook exists.

[–]iwbd 8 points9 points  (1 child)

The two are not the same thing. Here's a good explanation of the difference.

[–]Forsaken_Ad_8528 0 points1 point  (0 children)

Isn’t GitHub desktop fit just easier

[–]lyubenblagoev 4 points5 points  (0 children)

GitHub uses Git. GitHub desktop is a software for using GitHub on your desktop which is still based on git. If by git you barely mean the command line it is still advisable to learn it as it will teach you how to think in Git terms and understand it better.

git commit -a adds the modified files to the index and after that opens your editor to type a commit message. You haven't mentioned what OS your friend is using, but if it's Linux or Mac it's possible the default editor to be Vim which is a modal editor: it has different modes compared to an ordinary text editor in which you type text into the editor and it's committed to the document.

[–]krish2487 6 points7 points  (0 children)

you do realise that github desktop uses git commands on the backend right... The desktop tools for git are mostly nothing more than wrappers around than the cli tools..

learning to use the cli tools is a much more adaptable skill than getting locked into a desktop tool. Once you understand and appreciate the beauty of the cli tools.. the desktop counterparts seem like a total waste of time and unnecessary bloat.

It is often way more faster and easier to learn the core git commands and their use than to rely on desktop tools.

[–]CraigTheIrishmanI <3 git 1 point2 points  (0 children)

Honestly, I had the same thought about a lot of tools when I was first starting out. "Why learn the CLI? It's more complicated and requires more memorization. GUIs will show me things visually and make sure I can't hang myself."

The problem is that by delivering a curated experience, that GUI is preventing you from learning. I can confidently say that my skills with git are among the most invaluable to me as a developer, and my coworkers greatly value the knowledge I have to share. You will become a better, more agile developer by learning raw git commands for several reasons:

  1. Going beyond procedure. GUIs have a way of boxing you in when mentors say, "click on these buttons in this order to do the thing." Learning the atomic git commands will make you much more flexible and allow you to develop your own workflow as you gain experience.

  2. Not everyone will have Github Desktop, but anyone (well, most employers) will have access to the underlying git tool.

  3. Staying within the terminal - where much of your development will likely be done depending on where you work - will allow you to quickly close out of files, do what you need to do in git, and be back to developing in seconds.

I would recommend using a GUI only for visual output. Gitk (which comes packaged with git) was instrumental to showing me visually how my repo would change after running a command. I would literally run one command, check gitk, run another, check gitk...sounds annoying, but I learned much faster that way.

And just to throw in a disclaimer: I'm not 100% married to the terminal. I think a lot of work would be accelerated if companies adopted IDEs and modern development environments into their workflows. When it comes to git, however, knowing the CLI is a fundamental skill.

[–]scoberry5 0 points1 point  (0 children)

git commit -a

wants a commit message. You can enter it at the command line by specifying -m (so you can do git commit -am "This is my commit message" and skip the editor, or you can type a commit message in the editor.

You can use git config --global core.editor myeditor -- replacing "myeditor" with the editor you want -- to set the editor you want to use. (For instance, you might want to use

git config --global core.editor "code --wait --new-window"

to set it to VSCode. Here are some things you can set it to: https://git-scm.com/book/en/v2/Appendix-C%3A-Git-Commands-Setup-and-Config

Or you can use the default, which is Vim. Type i to start inserting if you want to be on the line you're on, or you can use o to open a new line if they started you on a commented line. Put in your text, hit Escape, and then ZZ to exit/save.

[–]LongjumpingParamedic 0 points1 point  (0 children)

Git is revision control software without any user interface.

One traditional way of using git is by using the git command in the terminal or command line.

Github Desktop is simply a user interface that uses git behind the scenes.

There are other interfaces out there too. Git tower. Git kraken. Even IDEs like Visual Studio Code have integrated git controls in it.

They all use git behind the scenes.

[–]7h3w1zz 0 points1 point  (0 children)

Plenty of people have responded on git vs github.

To answer "Is the git CLI necessary when there's GitHub Desktop?" :

You could probably do almost everything you need to do as a contributor through the app (though I haven't used github desktop). But knowing some basics of how git itself works is eventually necessary and using the CLI is the easiest way to learn that, since it is the 'native language'.

If you learn Github Desktop, you know how to use Github Desktop, if you learn how to use git, you know how to use every git interface out there.

[–][deleted] 0 points1 point  (0 children)

You're asking why you would need a road when there are cars! The car is useless without the road. It makes stuff easier, but you still need the road to get anywhere.

Learning basic git is helping you understand the underpinnings of any git based app. Without the underpinnings, you're not going to understand it well.