我的机器上有一个存储库 ins /opt/git/myrepo.git
然后我有两个工作目录:
/var/www/mysite.com /var/www/test.mysite.com
两者都是从 /opt/git/myrepo.git 克隆的
在 test.mysite.com 中,我创建了一个名为 myfirstbranch 的新分支,并将其推送到 repo:
git push origin myfirstbranch
然后,如果我执行 git branch -a 我会看到:
* master
myfirstbranch
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/myfirstbranch
现在,如果我转到 mysite.com 并执行 git fetch 然后 git branch -a,这就是我所看到的:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/myfirstbranch
所以没关系。但是,如果我这样做:
git push origin :myfirstbranch
从 mysite.com 然后转到 test.mysite.com 并执行 git fetch,然后 git branch -a 我仍然看到:
* master
myfirstbranch
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/myfirstbranch
为什么它仍然认为 remotes/origin/myfirstbranch 仍然存在?当我在 mysite.com 中执行 git branch -a 时,它不显示 remotes/origin/myfirstbranch
为什么有区别?