The difference between git git fetch and git fetch origin master

git fetch

Step 1:
First read .git/configthe configuration [remote origin]. If fetchone or more remote warehouses are not specified, all remote warehouses will be processed.

[remote “origin”]
	url = [email protected]:kaku/testGit.git
	fetch = +refs/heads/:refs/remotes/origin/

Step 2:
git fetch The latest version of all remote branches of the remote warehouse will be pulled into the Commit-ID" .git/FETCH_HEAD" file.
If there are multiple branches, FETCH_HEADthere will be multiple rows of data, and the first line git fetchwill be the remote branch with the same name of the current branch.

Insert image description here

git fetch origin master

Step 1 : As in
step 2
FETCH_HEAD above, there is only one row of data, which records git fetchthe latest version of the specified remote branch.Commit-ID
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_37646636/article/details/132927829