我在eclipse中有一个基于java的动态web项目,它放在git下用于源代码控制。 我想将这个项目上传到bitbucket的存储库中。为此,我使用了命令 下面 -
git remote add origin https://myself@bitbucket.org/myself/affablebean.git
git push -u origin --all # pushes up the repo and its refs for the first time
第二个命令给我一个错误。请告诉我为什么会这样,我该如何解决。
error: --all can't be combined with refspecs
usage: git push [<options>] [<repository> [<refspec>...]]
-v, --verbose be more verbose
-q, --quiet be more quiet.................
-u, --set-upstream set upstream for git pull/status
...........................
答案 0 :(得分:3)
git push
的{p> -u
为分支设置上游,它是一个期望refspec的子命令(引用规范:分支,提交等),因此它不能与--all一起使用。
git push --all origin
是正确的方法。
答案 1 :(得分:2)
简单的git push -u origin master
就足够了:不需要--all
。
假设您已在master
分支上本地添加并提交了文件。