One of the very first things you might do in Git is save files.
First we add them to the staging area with "git add ."
Then we commit them to version control with "git commit -m "put your notes here"
You can do it without the -m message, but you'll then need to add your notes in the git editor.
You can also add specific folders by typing "git add directory/"
Type "git diff" to see any discrepancies in your current files. If you've already added them to the staging area, you can see the differences in staged files by typing "diff --staged".
3. What if you want to get something off the stage?
You type "git reset HEAD filename" and the stage will be rolled back.
If you make a mistake or forget something, you can pull your changes off version control and back onto the stage by typing "git reset --soft HEAD^"
4. What if you want to add or update individual files?
You type "git commit --amend -m "Your new updates"
To connect to a remote repo, you need to set a bookmark for it.
So you type "git remote add origin url"
To add your local files to the remote repo, you type "git push -u origin master"
Lastly, don't run the reset HEAD commands after you've pushed. It's like changing the past, and as we know from sci-fi, that can leads to problems.
6. Cloning, branching, checking out, merging.
To clone a repo, type "git clone url".
To make changes to the repo, "git branch mychanges"
Then work on that repo by typing "git checkout mychanges"
If you want to add the changes to the master branch, go there with "git checkout master" then add them with "git merge mychanges"