Git
- 2. 覯蟯襴 ろ企?
覯 蟯襴 ろ 殊 覲襯 螳 磯 蠍磯 螻手碓 轟 覯 れ 覿 ろ
襦貉 覯 蟯襴 ろ 譴讌譴 覯 蟯襴 ろ 覿 覯 蟯襴 ろ
Git, Mecurial, Bazaar, DarcsCVS, Subversion, PerforceRCS
- 3. Git 旧
誤螳 る血
殊 覲襯
CVS, Subversion, Perforce, Bazaar Git
ろ る血
殊讌 殊 伎 殊 襷襷
- 4. Git 旧
Git朱
Working Directory
Staging Area(Index) 殊 Stage伎
貉る る
Staging Area 朱れ 貉る伎 蟲
る血朱
Modified
Staged
Committed
Modified Staged Committed
- 5. Git 覈轟
git config < --system | --global >
--system : /etc/gitconfig (ろ 覈 覈 レ れ)
--global : ~/.gitconfig (轟 蟆襷 れ)
: .git/config (轟 レ襷 れ)
れ 一 : .git/config > ~/.gitconfig > : /etc/gitconfig
git config user.name John Doe : author name れ
git config user.email johndoe@example.com : 企 譯殊 れ
git config core.editor emacs : ろ ク讌蠍 れ
git config merge.tool vimdiff : Diff 蟲 れ
git config list : れ 伎
git config alias.<shortcut> <git 覈轟> : 豢 覈 れ
- 6. Git 覈轟
git init
蠍一ヾ 襦碁ゼ Git朱 蟯襴螻 苦 覈
.git企朱 襴襯
--bare 旧 豢螳 襴襯 螳讌讌 (Shared repository襯 誤 )
git clone <repo> <directory>
蠍一ヾ レ襯 覲旧 (SVN Checkout)
SVN checkout
覯 覈 一危磯ゼ 覲旧
- 7. Git 覈轟
git status
殊
Untracked, Modified, Staged 襯
git diff
Modified 殊 Staged 手骸 觜蟲
git diff --cached
レ 貉る 手骸 Staged 殊 觜蟲
- 8. Git 覈轟 - add
git add <file>
殊 襦 豢蟇磯 Modified 殊 Stage
git add <directory>
襴 覈 殊 add
git add < i | --interactive >
add 覈
git add < p | --patch >
add 覈 patch 蠍磯
- 9. Git 覈轟 commit
git commit
Staging Area る血 貉る
git commit -a
Tracked 殊 朱 Staging Area j 貉る (add 覈 豢)
git commit m <message>
message襯 貉る覃讌襦 貉る
git commit --amend
豕蠏 貉る 覃讌襯 蟇磯 る血
蠍一ヾ 貉る 螻 襦 貉る 燕
襴覈語 語讌 襦貉 貉る 伎襷
- 10. Git 覈轟 rm, mv
git rm <file | directory>
Tracked 殊 (untracked 襦 覲蟆渚螻 企 殊 )
git rm cached <file | directory>
StagingArea襷 蟇壱螻 襴 殊 蟾 (殊 れ襦 Stage )
git mv <file_from> <fime_to>
殊 豺襯 企蟇磯 企 覦蠑碁 覈
- 11. Git 覈轟 log
git log
貉る ろ襴襯 螳朱 豢
git log p
螳 貉る diff蟆郁骸 豢
git log --pretty=<oneline | short | full | fuller | format:<format options>>
蠍磯蓋 伎語 螳讌襯 豢
format 旧 伎 襷 襷 蟆郁骸襦 豢 螳
git log -2
豕蠏 螳 ろ襴襷 豢
git log --graph
觚豺 襾語 ろ襴襯 覲伎譯朱 ろ 蠏碁 豢
- 12. Git 觚豺
blob
一危 覈
殊 る
tree
襴 蟲譟一 螳豌伎 伎, 朱
commit
襭誤碁Μ 覿覈 貉る 螳豌伎 伎
貉る 螳豌企ゼ 螳襴る 蠍磯蓋 觚豺
譴 觚豺襯 螳襴る HEAD
- 13. Git 覈轟 branch, checkout
git branch <branch name>
觚豺
git checkout <branch name>
企 觚豺襦 豌危(HEAD襯 企)
git checkout b <branch name>
觚豺襯 燕螻 焔 觚豺襦 豌危
git branch d <branch name>
觚豺
git checkout HEAD~2 <file>
覯 ろ朱伎
企 殊 襴觜 企 企 襴觜殊 襦 襴
- 14. Git 覈轟 reset
git reset HEAD~2 < --soft | -- mixed | --hard>
觚豺襯 HEAD 伎 2覯讌 襴觜殊朱 襴(ろ襴襯 螻 HEAD襯 企)
--soft : 襴 螻 碁煙(Staging Area) 蟾
--mixed : 襴襷 蟾
--hard : 襴 襴
豢譴 殊 伎襷 (覯 ろ伎蟇磯 貉る讌 殊 レ 譯殊 clean朱 )
ろ襴襯 蠍 覓語 語
語 覈視 貉る 讌磯 襦
Relative Refs
~ : 豌覯讌 譟一 磯手(襾語襯 襴觜)
^ : 覯碁 譟一
- 15. Git 覈轟 revert
git revert HEAD~2
襦 貉る 燕 HEAD 伎 覯讌 貉る 伎 襴
蠍一ヾ 貉る 讌 螻 襦 貉る 襴蠍 覓語 語螳 螳ロ
git reset HEAD~2 <file>
覯 ろ朱伎
Staging Area 殊 Unstaging
Command Scope Common use cases
git reset Commit-level 襦貉 觚豺 貉る 豬蟇磯 貉る讌
蠍
git reset File-level Unstage
git checkout Commit-level 觚豺,襴觜
git checkout File-level 襴 蠍
git revert Commit-level 螻旧 レ 貉る 襴
- 16. Git 覈轟 remote
git remote -v
襦語 焔 襴覈 レ襯 URL螻 蟷
git remote add <豢企> <url>
URL 襴覈 レ襯 豢企朱 豢螳(git clone origi朱 豢企 れ)
git fetch <豢企>
襴覈 レ 一危磯ゼ 螳語る 覈
git pull
Fetch襯 螻 朱 襦貉 觚豺 襾語
git push <襴覈 レ 企> <觚豺>
觚豺襯 襴覈語レ 語
- 17. Git 覈轟 merge
git merge <branch name>
企 觚豺襯 觚豺襦 覲
觚豺螳 螳襴る 貉る 螳 螻牛 譟一 襯 3-way Merge
- 18. Git 覈轟 rebase
git rebase <branch>
蟆 觚豺 觚豺 螻牛 譟一覿 觚豺 蟾讌 覲蟆曙 蟆 觚豺覿 谿襦襦
貉る 螳豌企ゼ 襦 燕伎
襴覯伎 襴覯伎 master 蠍
Fast-forward Merge
- 19. Git Rebase
企 螻糾 レ Push 貉る Rebase讌 襷 蟆!
1
2 4
3
C4 C4` 狩 襴觜殊
螳 Merge襯 れ
るジ History Rewrite 覈
(cherry-pick企 commit amend)
螳 覓語 覦
- 20. Git るジ
ろ襴 殊 覲蟆暑 蟆曙郁 覦 貅伎
1. 觚豺 螳覦 觚豺襯 Merge
2. Merge 譴 Conflict 覦
3. Conflict襯 Merge 螻殊 殊
4. 觚豺 螳覦 襭 觚豺襯 螳覦 觚豺襦 Merge
5. 暑 殊 伎 觚豺 譟一 觚豺 螳覦
觚豺 伎 狩螻 觚豺襷 伎 るゴ蠍 覓語
暑 觚豺 伎 Merge
(ろ襴 螳蟆 覲糾規螳 企れ)
れ襯 譴願鍵 Long running 觚豺 譯手鍵 Pull !!!
- 21. Git 碁 蟲
觜蟲 WinMerge 蠏語 xdocdiff
Git朱 diff襯 蠍郁 企れ 觜蟲襯
http://namocom.tistory.com/320
襴 Merge UniMerge
蟆る碁ゼ 一 螳朱 覲
https://www.assetstore.unity3d.com/kr/#!/content/9733
.gitignore 危
ろ企 IDE, 襦蠏碁覦 語伎 襷 .ignore 殊
https://www.gitignore.io/
- 22. 谿瑚
Pro git - http://git-scm.com/book/ko/v1/
Attlassian git tutorial - https://www.atlassian.com/git/tutorials/
Git 觚豺 覦一郁鍵 - http://learnbranch.urigit.com/
A successful git branching model -
http://dogfeet.github.io/articles/2011/a-successful-git-branching-model.html
Git Workflow models
http://www.slideshare.net/lemiorhan/git-and-git-workflow-models-as-catalysts-of-software-
development?qid=35e0e751-5f82-443f-ba06-7d8f2816c96d&v=qf1&b=&from_search=2
磯襭 - http://cafe.naver.com/devrookie/7393