1) you need to resolve your current index first
[cc lang=’c’]
rong:wang_iOS apple$ git checkout develop
eqi/Info.plist: needs merge
error: you need to resolve your current index first
分析:这是在分支切换的时候,执行  git pull (fetch+merge = pull),由于长时间没有和remote分支merge,分支间的冲突,解决这个冲突就好了。

2) Updates were rejected because the tip of your current branch is behind
[cc lang=’c’]
localhost:chexun_iOS apple$ git push
! [rejected] develop -> develop (non-fast-forward)
! [rejected] feature_praiseDetail_commentList -> feature_praiseDetail_commentList (non-fast-forward)
error: failed to push some refs to ‘’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
分析:hint: Updates were rejected because a pushed branch tip is behind its remote 远程仓库的分支比本地的代码要新所以远程的repository和本地的repository冲突。没有pull…

// 1.首先先pull到本地(避免下面一步覆盖远程)
  git pull origin develop
// 2. 强制push到远程(谨慎覆盖远程)
 git push -u origin develop -f

3)git push时出现的问题
[cc lang=’c’]
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)

fatal: The current branch Develop has no upstream branch.
To push the current branch and set the remote as upstream, use

git push –set-upstream origin Develop

解: 情况:在本地用clone了一份代码~ 这个项目是第一次提交~ 直接用的git push(没有指定分支)
看git给的提示 git config –global push.default matching
push.default包含nothing(不push任何分支), matching (本地分支和服务器匹配), upstream(当前分支push到upstream分支), simple(当前分支push到upstream分支上,名字不匹配拒绝,git2.0+默认 安全), current(将当前分支push到同名分支)这五个值
4.error: You have not concluded your merge
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
解:保留本地 git merge –abort

[cc lang=’c’]





[cc lang=’c’]
git rm –cached ***.xcodeproj/project.xcworkspace/xcuserdata/***.xcuserdatad/UserInterfaceState.xcuserstate



电子邮件地址不会被公开。 必填项已用*标注