Page 2
git
• Linus
• git : git, linux, RoR
•
Page 4
git vs svn• -> iPhone
•
• vs
• branch tag
•
Page 6
git
• branch/tag
• head
• master
• staging index/repo/working copy
• origin
Page 10
git
• git clone
• git add .
• git commit [-a][—amend]
• git pull origin master
• git push origin master
Page 12
Configuration• git config —list
• git config [—global] user.name aelam
• git config user.email [email protected]
• ignore
• system, global, project
• alias
Page 15
Create
• git init
• git clone
Page 16
Branches & Tags
• git branch [-d][-D] new_branch
• git checkout new_branch
• git tag [-d][-D] 1.0
• git checkout 1.0
Page 17
Merge&Rebase
• git checkout master
• git merge a_branch
• git rebase [—continue][—abort]
Page 21
Update & Publish
• git pull origin master [—rebase][—tags]
• git pull origin a_tag
• git push origin master
• pull = fetch + merge
• ? git push new_server master
Page 23
• git reset HEAD~3 — file_path
• git checkout HEAD~3 — file_path
Page 24
rebase merge
• git pull origin master —rebase [git rebase origin master]
• git pull origin master git merge origin master
Page 26
SourcTree rebase merge
Page 27
Tower rebase merge
Page 28
• .gitignore
• git rm —cached -r Pods/
Page 29
rebase/merge
• git checkout —thiers file_path
• git checkout —ours file_path
Page 30
reset
• git reset —hard HEAD
• git reset HEAD^^
• git reset HEAD~2
Page 31
git with svn
• git svn clone
• git svn rebase * !!rebase commit
• git svn dcommit
Page 32
git submodule
• git submodule add /path/to/Vendors
• git submodule init
• git submodule update
Page 33
git
• github 5
• bitbucket 5
Page 34
git GUI
• github
• gitx
• SourceTree
• Tower
Page 36
Ref
• gitcheatsheet https://github.com/AlexZeitler/gitcheatsheet/blob/master/gitcheatsheet.pdf