GitHub上有一个现有的仓库。然后,我已经在本地编码了一个项目,并试图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.
它表示我的本地分支(my_branch
)在远程分支后面。我已经尝试过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
请有人建议我将项目push
到远程分支机构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.
答案 0 :(得分:-3)
json-server:
build: ./json-server
volumes:
- ./json-server/json/:/data
ports:
- 3000:3000