在'git push'上发生错误,但push动作似乎成功

bwntbbo3  于 2022-11-20  发布在  Git
关注(0)|答案(1)|浏览(180)

当我推送到github时,我收到一个错误消息,说git无法推送一些引用,但我可以在远程看到推送成功。
以下是详细信息:

[akhann16@login006 swift_proj]$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
  git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
  git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 7, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.17 KiB | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To git@github.com:khanna-lab/cadre.git
   a1563e5..2223084  ak-tinkering -> ak-tinkering
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:khanna-lab/cadre.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push only the current branch.

我看到推送成功,但我不明白为什么会出现此错误或它在说什么?

vwkv1x7d

vwkv1x7d1#

实际上,这是因为我使用的是一个旧的git版本1.8.3.1。我无法在我使用的系统上更新git,所以我更新了设置配置设置:

git config --global push.default simple

相关问题