我可以克隆回购和拉动,但不能推 [英] I can clone repo and pull, but I can't push
问题描述
我正在尝试将更改推送到远程存储库,但是由于某些原因,我不能.
I'm trying to push changes to the remote repo, but for some reason I can't.
当我git branch
时,这就是我看到的:
When I git branch
this is what I see:
develop
feature/all_features
* feature/Tommaso
当我git status
时:
On branch feature/Tommaso
nothing to commit, working directory clean
我可以从开发中clone
回购和pull
,但是当我执行git pull
时,这就是我得到的:
I could clone
the repo and pull
from the develop, but when I do git pull
this is what I get:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> feature/Tommaso
我想问题是远程仓库没有我在本地创建的当前分支.
I guess the problem is that the remote repo does not have the current branch I created locally.
:我还不够清楚:我想在feature/allfeatures
中创建分支feature/Tommaso
.我对那些可能以为我正在尝试创建develop
I was not sufficiently clear: I'd like to create the branch feature/Tommaso
in feature/allfeatures
. I say this for those of you who may have thought I was trying to create a branch of the develop
是吗?我该如何解决?
Is that it? How can I solve it?
如果您需要其他信息来解决此问题,请告诉我.预先谢谢你
Tell me if you need other info to address the issue. Thank you in advance
推荐答案
尝试以下命令.
$ git pull origin <branch_name>
$ git push origin HEAD:refs/for/<branch_name>
如果要创建自己的集成分支.
If you want to create your own integration branch.
$ git checkout -b <integration branch name> origin/<origin branch name>
$ git push origin <integration branch name>
这篇关于我可以克隆回购和拉动,但不能推的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!