Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git推送到单分支_Git_Branch - Fatal编程技术网

Git推送到单分支

Git推送到单分支,git,branch,Git,Branch,我有一份回购协议,我想推进到开发部门 我用过 $ git checkout develop Already on 'develop' Your branch is up-to-date with 'origin/develop'. 并且还做了开发部门的git pull 我想 $ git push 向发展部门推进。但事实并非如此 djave at djave-comp in ~/projects/project on develop* $ git push Counting objects:

我有一份回购协议,我想推进到开发部门

我用过

$ git checkout develop
Already on 'develop'
Your branch is up-to-date with 'origin/develop'.
并且还做了开发部门的git pull

我想

$ git push
向发展部门推进。但事实并非如此

djave at djave-comp in ~/projects/project on develop*
$ git push
Counting objects: 49, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (49/49), 25.45 KiB | 0 bytes/s, done.
Total 49 (delta 38), reused 0 (delta 0)
To bitbucket.org:djave/project.git
   f311657..16b42c7  develop -> develop
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'djave@bitbucket.org:djave/project.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
看起来它正在推动发展:

但then也试图推送到主分支,但失败了:

 ! [rejected]        master -> master (non-fast-forward)
我希望它能推进到开发部门并取得成功

我怎样才能让git推送到development分支呢


很抱歉,如果这是重复的,您已经进行了广泛的搜索,但是找不到正确的问题组合,或者标题没有使用正确的术语请随意更新标题

git push <remote_alias> <branch_name>

这可能是一个愚蠢的问题。当我在一个分支上使用git-push时,有没有一种方法可以说,只推这个分支?啊,也许是git-push-originHEAD@Djave您可以为此使用配置,请参见此处:@SurajRao ah yes–谢谢
git push <remote_alias> <branch_name>
git push origin develop