备忘录-part1
来源1
commit
When we use git commit, git also maintains a history of which commits were made when. That’s why most commits have ancestor commits above them. you can think of commits as snapshots of the project.
- commit, adding a node in the commit tree: git commit
- commit-id: git checkout [commit-id] # detached head
branch
A branch essentially says “I want to include the work of this commit and all parent commits.”
- create a new branch: git branch [branch-name]
- checkout: git checkout [branch-name]
- create and checkout a new branch: git checkout -b [branch-name]
merge
Merging in Git creates a special commit that has two unique parents. A commit with two parents essentially means “I want to include all the work fr