git push --set-upstream staging master
的输出:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:exampleOrgAbcxyz/infrastracture-staging.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.
我有一个staging
遥控器。我想将当前仓库的staging
分支推送到其staging
分支上的master
远程。
git remote -v
composer git@bitbucket.org:exampleOrgAbcxyz/infrastructure.git (fetch)
composer git@bitbucket.org:exampleOrgAbcxyz/infrastructure.git (push)
origin git@bitbucket.org:exampleOrgAbcxyz/infrastructure.git (fetch)
origin git@bitbucket.org:exampleOrgAbcxyz/infrastructure.git (push)
staging git@bitbucket.org:exampleOrgAbcxyz/infrastracture-staging.git (fetch)
staging git@bitbucket.org:exampleOrgAbcxyz/infrastracture-staging.git (push)
答案 0 :(得分:1)
git push staging master
会尝试将 master
分支从您的本地仓库推送到master
回购中的staging
分支。在这种情况下,它会失败,因为您的本地master
位于远程的staging
之后。
要将master
推送到远程git push staging staging:master
,您需要git checkout staging
。或/htdocs
,然后是原始命令。