21. BEST PRACTICE
Commit
Commit Message
1 | a short summary of the change
2 |
3 | if needed
4 | why you made the change
5 | …
• should be small
• should not consist of changes which can be logically separable
22. OTHER USEFUL COMMAND
Show commit logs $ git log
Show the working tree status $ git status
Show difference between the
latest commit and the working
tree
$ git diff HEAD
30. COMMANDS
Show branches $ git branch
Create a branch $ git branch <branch>
Checkout a branch $ git checkout <branch>
Merge <branch> to the
current branch
$ git merge <branch>
Rebase <branch> to
the current branch
$ git rebase <branch>
35. WHERETO CREATE
Github
Bitbucket
Public Repository … free
Public / Private Repository … free up to 5 users
https://github.com/
https://bitbucket.org/
https://education.github.com/
• A git server you have
• Storage services like Dropbox
• Hosting Services
43. INSTALLATION
Linux
$ yum install git-core
$ apt-get install git
Mac
$ brew install git
Windows
http://msysgit.github.com/
Git may be already installed. To update by homebrew
44. INITIAL CONFIGURATION
git config --global user.name “Your Name"
git config --global user.email “mail@example.com“
!
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.grep auto
!
git config --global core.excludesfile $HOME/.gitignore
git config --global push.default current