git commits the local branch to the remote branch, the difference between fetch and pull

Article reference

http://blog.csdn.net/mccwlh/article/details/47610583

 

// Submit the local test branch as the remote master branch
$ git push origin test:master    
     
// Submit the local test branch as the remote test branch
$ git push origin test:test            

If the :left branch is empty, then the :right remote branch will be deleted.
// The test just submitted to the remote will be deleted, but it will be saved locally, don't worry
$ git push origin :test     

 

 

Difference between git fetch and pull

 

git fetch will only update the commit id of the remote library associated with the local library to the latest, and will not automatically merge

(For example: a new subsection is created remotely, to get the new subsection locally, you need to use git fetch )

 

git pull will update the local library to the latest state of the remote library and merge it to the local

pull=fetch+merge

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326751948&siteId=291194637