Git branch - branch Profile

When a commit operation git commit, Git first calculates a checksum for each subdirectory.

git add README test.rb LICENCE

git commit -m 'The initial commit of my project'

 

Creating branch

git branch testing

 

View bifurcation

git log --oneline --graph

 

Branch switch

git checkout testing 

At this point HEAD branch is currently located

 

 

At this time, then submit again

vim test.rb

git commit -a -m 'made a change'

HEAD branch will automatically move forward with the commit operation

 

If the switch back to the master node, and then modify the file and submit

At this point the project will fork

Available git log --oneline --graph View

 

New branch and merge

Create a new branch quickly and simultaneously switched to that branch

git checkout -b iss53

It is shorthand for the following two commands:

git branch iss53

git checkout iss53

 

 

Consolidated project

git merge hotfix

 

Deleted branches

git branch -d hotfix

 

Branches merge conflicts when encountered

git status command to view those files without the merger because it contains in unincorporated state

 

Guess you like

Origin www.cnblogs.com/zhichun/p/11756086.html