最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]git push出错:The local repository is out of date

Git crifan 6766浏览 0评论

[已解决]git stash pop出错:needs merge unable to refresh index

之后,提交失败:

The local repository is out of date

Make sure all changes have been pulled from the remote repository and try again

所以去git ush,然后又出错,最终通过先

git pull

之后,再去

git push

才可以:

licrifandeMacBook-Pro:iOS-Client crifan$ git status
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
licrifandeMacBook-Pro:iOS-Client crifan$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from ‘matching’ to ‘simple’. To squelch this message
and maintain the traditional behavior, 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.
Since Git 2.0, Git defaults 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)
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to ‘https://git.oschina.net/windoze/iOS-Client.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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.
licrifandeMacBook-Pro:iOS-Client crifan$ git pull
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
   b13d68a..3113298  master     -> origin/master
Merge made by the ‘recursive’ strategy.
 JianDao/ContactItemTableViewCell.swift          |  5 +++++
 JianDao/ConversationManageViewController.swift  |  2 ++
 JianDao/SelectablePersonItemTableViewCell.swift | 11 +++++++
 3 files changed, 14 insertions(+), 4 deletions(-)
licrifandeMacBook-Pro:iOS-Client crifan$ git status
On branch master
Your branch is ahead of ‘origin/master’ by 2 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
licrifandeMacBook-Pro:iOS-Client crifan$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from ‘matching’ to ‘simple’. To squelch this message
and maintain the traditional behavior, 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.
Since Git 2.0, Git defaults 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)
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.86 KiB | 0 bytes/s, done.
Total 13 (delta 8), reused 0 (delta 0)
   3113298..41cc268  master -> master
licrifandeMacBook-Pro:iOS-Client crifan$

即可。

转载请注明:在路上 » [已解决]git push出错:The local repository is out of date

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.174 seconds, using 22.12MB memory