A cheat-sheet to reference while getting started with git.
1. Pull down a copy of the repository:
git clone <repository>
2. List available branches (on the remote server)
git branch -r
3. Create a new branch
git branch <branchname>
4. Switch to an existing branch
git checkout <branchname>
5. After you have made changes to your local files, you can review what has changed with:
6. If you want to add a few of those changes files in your next commit:
git add <file>
7. Commit those changes files to your local ‘stage’ (doesn’t push them back up to the remote server)
git commit -m "Your message here."
8. Push your committed changes to the remote repository:
git push origin <branch>
9. Tag a snapshot of the code:
git tag -a <v1.2> -m "Tagging 1.2 with fixes for x,y,z"
10. merge changes from a branch to back to master
git checkout master git merge dev