最近 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
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
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)
之前一直不就用这句的嘛?不是好好的嘛?为什么还要设置?
我糊里糊涂设置了
git config --global push.default matching
结果再 git push, 又显示
Counting objects: 34, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.37 KiB | 0 bytes/s, done.
Total 10 (delta 8), reused 0 (delta 0)
To [email protected]:realxxx/realxxx.git
e178173..193exxx feature/YBY -> feature/YBY
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to '[email protected]:realxxx/realxxx.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.
这是成功还是不成功?
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs
这句说的是什么?我明明就是从 feature/YBY -> feature/YBY啊!
git config --global push.default simple