push
到远程分支
my_branch
.
我得到以下信息:
$ git push -u origin my_branch
To github.com:xxxx/richard-m-xxxx.git
! [rejected] my_branch -> my_branch (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxx/richard-m-xxxx.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
上面说我当地的分部(
)在遥远的分支后面。我试过了
git pull
$ git pull
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> my_branch
有人能告诉我去的步骤吗
推
我的项目到远程分支
我的分公司
非常感谢。
更新
$ git pull origin my_branch
From github.com:xxxx/richard-m-xxxx
* branch my_branch -> FETCH_HEAD
fatal: refusing to merge unrelated histories
再说一遍:
$ git push origin my_branch
To github.com:xxxx/richard-m-xxxx.git
! [rejected] my_branch -> my_branch (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxx/richard-m-xxxx.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.