Github 是我项目的默认存储库(只是将“origin”重命名为“github”)。发生了一些事情,以至于“git push”导致“非快进更新”错误,即使“git push github master”有效。“git pull”和“git pull github master”都表示最新状态。我如何 (a) 确保 Github 上没有未合并的更改并 (b) 更正非快进错误?
$ git status
# On branch master
nothing to commit (working directory clean)
$ git pull
Already up-to-date.
$ git pull github master
From github.com:MikeBlyth/mission_net
* branch master -> FETCH_HEAD
Already up-to-date.
$ git push github master
Everything up-to-date
$ git push
To git@github.com:MikeBlyth/mission_net.git
! [rejected] add_command -> add_command (non-fast-forward)
error: failed to push some refs to 'git@github.com:MikeBlyth/mission_net.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
我的 git 配置文件是
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "github"]
url = git@github.com:MikeBlyth/mission_net.git
fetch = +refs/heads/*:refs/remotes/github/*
[branch "master"]
remote = github
merge = refs/heads/master
[remote "heroku"]
url = git@heroku.com:joslink.git
fetch = +refs/heads/*:refs/remotes/heroku/*
merge = refs/heads/master
[remote "heroku"]
url = git@heroku.com:joslink.git
fetch = +refs/heads/*:refs/remotes/heroku/*