一個用Git互動視覺化教學的專案
Learn git branching 這個是Git 的視覺化教學專案 是能夠讓新手快速上手Git的教程

這兩天花時間把 Learn Git Branching Main部分的做了一遍。 對理解git分支的使用很有幫助,另外發現git的幫助文件和github的幫助文件都很詳細,應該好好讀一遍。
使用命令檢視 答案 $ show solution 複製程式碼
答案記錄在下面
1.1 Introduction to Git Commits
git commit git commit 複製程式碼
1.2 Branching in Git
git branch bugFix git checkout bugFix 複製程式碼
1.3 Merging in Git
git checkout -b bugFix git commit git checkout master git commit git merge bugFix 複製程式碼
1.4 Rebase Introduction
git checkout -b bugFix git commit git checkout master git commit git checkout bugFix git rebase master 複製程式碼
2.1 Detach yo’ HEAD
git checkout C4 複製程式碼
2.2 Relative refs (^)
git checkout C4^ 複製程式碼
2.3 Relative refs #2 (~)
git branch -f master C6 git branch -f bugFix C0 git checkout C1 複製程式碼
2.4 Reversing Changes in Git
git reset local~1 git checkout pushed git revert pushed 複製程式碼
3.1 Cherry-pick Intro
git cherry-pick C3 C4 C7 複製程式碼
3.2 Interactive Rebase Intro
git rebase -i master~4 --aboveAll 複製程式碼
4.1 Grabbing Just 1 Commit
git checkout master git cherry-pick C4 複製程式碼
4.2 Juggling Commits
git rebase -i caption~2 --aboveAll git commit --amend git rebase -i caption~2 --aboveAll git branch -f master caption 複製程式碼
4.3 Juggling Commits #2
git checkout master git cherry-pick C2 git commit --amend git cherry-pick C3 複製程式碼
4.4 Git Tags
git tag v0 C1 git tag v1 C2 git checkout C2 複製程式碼
4.5 Git Describe
git commit 複製程式碼
5.1 Rebasing over 9000 times
git rebase master bugFix git rebase bugFix side git rebase side another git rebase another master 複製程式碼