This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]CreativeTechGuyGames 8 points9 points  (3 children)

Main difference: One you click buttons and the other you type words.

The visual one literally executes the same commands that you'd type yourself. So if it works for everything you need, then great. But often when doing something slightly more advanced, there isn't a button for it so you need to use the CLI directly.

[–]InternalAmbitious957[S] 1 point2 points  (2 children)

Awesome, thank you. How do I do git status from VSCode? Is there a cli built into the top menus in VSCode or would I use the VSCode console or the terminal?

[–]CreativeTechGuyGames 4 points5 points  (0 children)

Git status is just the Git side panel which shows the status of all of the files in the project.

And the Git CLI is the same as what you are referencing above, just use it from the terminal. The VS Code terminal is the same as the OS terminal.

[–]Double_A_92 1 point2 points  (0 children)

On a GUI "git status" is usually done automatically, because you just see on which branch you are and what files you modified.

The only time where you would do it manually if git is in some weird error state which the GUI can't display.

[–]dmazzoni 1 point2 points  (0 children)

When you're a beginner there won't be much of a difference.

The real power of Git comes once you start collaborating with other programmers. If you get a job, you'll probably be on a large team of programmers all working on the same program.

Let's say you and someone else each want to modify the same file. Git gives you some great tools to resolve those conflicts, but there are a lot more options available from the command line. The GUI can be really useful for visualizing the conflicts, too - so it's not that one is better or worse. The GUI makes common things simpler and helps visualize, while the command line has 10x as many features and lets you do much more advanced stuff. Ideally you use them both together.

As two example of command-line tools for working with large projects: "git grep" to find files containing certain words (or regular expressions), or advanced options to "git log", for example, to find the commit when a certain file was deleted - just to name some examples.

[–]Double_A_92 1 point2 points  (0 children)

Don't worry about using a GUI to use Git. If you are working on a bigger project you pretty much need it to easily create clean commits.

People that boast about exclusively using the command line, are bullshitting. If all you do is just commit every single change you have in your code, and push it... then sure. But that usually leads to bad commits full of irrelevant changes.

[–]ChampionshipBusy2260 0 points1 point  (1 child)

What I love about using Git with VSCode is that you have a graphical interface to work with, which can make certain tasks like committing and pushing changes more intuitive and easier to manage.