git fetch
Step 1:
First read .git/config
the configuration [remote origin]
. If fetch
one 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_HEAD
there will be multiple rows of data, and the first line git fetch
will be the remote branch with the same name of the current branch.
git fetch origin master
Step 1 : As in
step 2
FETCH_HEAD
above, there is only one row of data, which records git fetch
the latest version of the specified remote branch.Commit-ID