git fetch <remote>和git fetch <remote> <branch> </branch> </remote> </remote>之间的区别

时间:2013-05-16 15:39:12

标签: git

我有一个我已经使用的远程分支,我想更新它上面的refs,所以我输入git fetch <remote> <branch>并且分支没有更新最新的refs。我发现我必须使用git fetch <remote>(没有分支)来获取该分支上的当前远程更新。有人可以解释一下吗?

1 个答案:

答案 0 :(得分:4)

git fetch <remote> <branch>将从给定的远程获取单个给定分支并将其存储在FETCH_HEAD中。

git fetch <remote>将使用默认的refspec,它通常配置为remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*,因此将获取所有分支并将它们存储在相应的远程分支中。