Differences git fetch and git pull and git fetch the difference between git pull of

1, git fetch the equivalent is to get the latest from remote to local, will not automatically merge, the following command:

 

 git fetch orgin master // will download the master remote repository to the local branch of the current branch in 

 git log -p master ..origin / master // compare local master branch and origin / master branch differences 

 git merge origin / master // conduct merge

Also use the following commands:

git fetch origin master: tmp // Get the latest branch from a remote repository master, to establish a branch in the local tmp 

git diff tmp // will compare the current branch and tmp 

git merge tmp // merge tmp branch to the current branch

 

2. git pull: the equivalent for the latest version to merge the local and remote

git pull origin master

git pull equivalent to get the latest version from the remote to the local and merge

In actual use, git fetch more secure

 

1, git fetch the equivalent is to get the latest from remote to local, will not automatically merge, the following command:

 

 git fetch orgin master // will download the master remote repository to the local branch of the current branch in 

 git log -p master ..origin / master // compare local master branch and origin / master branch differences 

 git merge origin / master // conduct merge

Also use the following commands:

git fetch origin master: tmp // Get the latest branch from a remote repository master, to establish a branch in the local tmp 

git diff tmp // will compare the current branch and tmp 

git merge tmp // merge tmp branch to the current branch

 

2. git pull: the equivalent for the latest version to merge the local and remote

git pull origin master

git pull equivalent to get the latest version from the remote to the local and merge

In actual use, git fetch more secure

Guess you like

Origin www.cnblogs.com/lqh969696/p/11346671.html