Как я могу исправить ошибку git push rejected? - PullRequest
0 голосов
/ 26 июня 2018
╭─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?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...