Committing and Pushing a Git Repo from VSCode
Navigate to the project repo from the command line.
Open VSCode set it to work on the current directory.
code -r .
Now find the Source Control icons on the left side bar. It looks like a branch and should have a blue circle with an number in it which is the number of changes that need to be committed. Click it.
You should see all of the changed files listed.
Find the box at the top with the work Message in it.
Type in a short message (<140 characters) about the work in this commit. You don’t have to get fancy, but having useful commit messages will help you find specific changes later. You can just use the word
save if you are only using Git as a way to backup your code and not really to manage different versions.
Once you have entered a message click the check or
⚠️ YOU ARE NOT DONE YET! People frequently stop here and think their stuff is saved. It’s not.
Now you have to do the second part, push the committed change(s) up to GitLab (or wherever).
Look in the bottom left status bar for either a cloud with an arrow in it (if it is your first commit) or some arrows with numbers.
If you made one commit you will see a 1 and an up arrow. Click it.
Wait for the push to finish and notice it changes into circular arrows, which can be clicked to refresh that state of what needs to be pushed or pulled down in order to sync up your local version with the master.