Code School offers free Git tutorial – 15 minutes. Tutorial covers adding source code to the repository and push the master to origin (remote). Also, it covers how to create a branch and merge back to the trunk. In a short time, learned important commands. Very useful!
Here are commands that I learned from this tutorial.
Several important concepts.
- master : local repository
- origin : remote repository
- push -u origin master : push master code to origin and -u remember origin and master, so later I can skip origin master. Just push
- checkout — file_name : Revert back the source code to when file_name file was committed.
- branch branch_name : Create a branch with branch_name
- checkout branch_name : Check out branch_name branch
- branch -d branch_name : Delete a branch branch_name