我正面临 git push 的问题。我创建了一个新分支,创建了一个新文件并提交了评论。然后我做了一个git push origin master
。我在 github 上看到了变化。
但是当我做 a 时git push
,它不会将更改发送到远程仓库,即远程工作仓库(https://github.com//work-repo.git)。
$ git status
# On branch mybranch
nothing to commit (working directory clean)
$ git push
Counting objects: 16, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 607 bytes, done.
Total 6 (delta 5), reused 0 (delta 0)
To https://github.com/<myuser>/work-repo.git
16ff794..55e4338 master -> master
当我转到 www github 并尝试在远程工作存储库上执行“拉取请求”时,我看到有多个提交(来自我的其他 git 分支 + 这个当前分支),我不能只选择这个这个拉取请求。
早些时候,对于其他分支机构,git push
工作正常,并将更改发送到远程工作存储库。这次不知道是什么问题。
我应该检查什么?
更新:
当我做 agit push -u origin <your_local_branch_name>:<your_remote_branch_name>
时,我得到这个消息:
git push -u origin mybranch:master
To https://github.com/<myuser>/work-repo.git
! [rejected] mybranch -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/<myuser>/work-repo.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
更新: 由于我无法弄清楚并且没有得到任何回应,我清理了回购并从远程重新开始并重新开始。
模组:请立即关闭此问题。
谢谢。