如何解决有关git push拒绝错误的问题?

时间:2018-06-26 13:44:56

标签: git

╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git push origin devel                                                                                                                                                 1 ↵
Everything up-to-date
╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git status 
On branch devel
Your branch is up-to-date with 'origin/devel'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    include/cscope
    include/cscope.files
    sample/cscope.out

nothing added to commit but untracked files present (use "git add" to track)
╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git checkout devel 
Already on 'devel'
Your branch is up-to-date with 'origin/devel'.
╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git push
To git@github.com:varram-suh/mpp.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxx/xxxx.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.
╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git pull                                                                                                                                                              1 ↵
Current branch devel is up to date.
╭─ksoo@ksoo-compnay ~/hisdk/mpp  ‹devel*› 
╰─$ git push
To git@github.com:varram-suh/mpp.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxx/xxx.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 push时出现错误,这可能是分支问题。如果指定分支,则不会出错。

例如,当我运行命令时:     git pull origin devel,     git push origin devel

以前没有错误。我将如何解决这个问题?

编辑: 我使用'git config --global push.default current'解决了这个问题

以前没有错误,为什么我的git config更改了?

0 个答案:

没有答案