我正在尝试推送最新的本地更改,但出现错误。
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'https://******************.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.
我所做的
git pull
始终返回Already up to date.
。
git reset --hard
返回HEAD is now at ****** COMMITNAME
。正确。
git fetch
和git merge
呼叫git merge
时传回fatal: No current branch.
。
我想做的
我下面要做的只是。
git add .
git commit -m ""
git push origin dev
现在,git push origin dev
就是问题所在。
我不知道该怎么办。有人知道解决办法吗?
1条答案
按热度按时间thigvfpy1#
为了确保你的本地dev分支不在远程dev分支之前,在推送之前拉并合并更改。这可以通过rebase来完成。