在你的alice存储库中试试这个(在push之前):
git config push.default tracking
或者,使用git config将其配置为默认值global ....
Git push默认指向的是源存储库(通常是您从中克隆出当前存储库的存储库),但它默认不推送当前分支——它默认只推送源存储库和目标存储库中同时存在的分支。
push.default配置变量(参见git-config(1))控制git push在没有给定任何“refspec”参数(即存储库名称后面的内容)时将推送什么。默认值提供上述行为。
下面是push.default的可能值:
nothing
This forces you to supply a “refspec”.
matching (the default)
This pushes all branches that exist in both the source repository and the destination repository.
This is completely independent of the branch that is currently checked out.
upstream or tracking
(Both values mean the same thing. The later was deprecated to avoid confusion with “remote-tracking” branches. The former was introduced in 1.7.4.2, so you will have to use the latter if you are using Git 1.7.3.1.)
These push the current branch to the branch specified by its “upstream” configuration.
current
This pushes the current branch to the branch of the same name at the destination repository.
These last two end up being the same for common cases (e.g. working on local master which uses origin/master as its upstream), but they are different when the local branch has a different name from its “upstream” branch:
git checkout master
# hack, commit, hack, commit
# bug report comes in, we want a fix on master without the above commits
git checkout -b quickfix origin/master # "upstream" is master on origin
# fix, commit
git push
With push.default equal to upstream (or tracking), the push would go to origin’s master branch. When it is equal to current, the push would go to origin’s quickfix branch.
在您的场景中,一旦建立了bare的master,匹配设置将更新它。要建立它,你可以使用git push origin master一次。
然而,上游设置(或当前设置)似乎更符合你的期望,所以你可能想尝试一下:
# try it once (in Git 1.7.2 and later)
git -c push.default=upstream push
# configure it for only this repository
git config push.default upstream
# configure it for all repositories that do not override it themselves
git config --global push.default upstream
(同样,如果你仍然在使用1.7.4.2之前的Git,你将需要使用跟踪而不是上行)。