Sorry, I know this is a newbie question, but I’m just trying to follow along.
In the lesson “Creating Snapshots” → “5. Committing Changes”
Mosh types git commit into the command line and it goes straight to VS code and opens a git file.
When I try the same thing, my VS Code gives me the message “nothing to commit, working tree clean” and doesn’t open VS Code. Am I missing something? If git commit doesn’t go straight to VS code anymore, how do I open Git in VSCode from the command line?
Hang on. I think I just answered my own question by opening a new file and practicing with it.
Annnd…I feel a little bit silly.
Once I’ve added files to the staging area (git add), when I type git commit, it does open VS code. I guess it’s one way of doing a commit, while git commit -m is the other.
The ‘-m’ is an option meaning ‘message’. It is telling your computer that you want to use a command in the git application called commit, and you would optionally also like to pass in a message (typically a short one). If you do not use the ‘-m’ option then it will open the text editor you have stated in your git config file so you can type the message (typically a longer message) that way.
I haven’t used vs code in a while, but I am pretty sure support for git is built into it. If you open a file that is in a git repository then it should give you some feedback for that, and well as let you use git commands using buttons and gui interfaces.