美文网首页
git 使用中遇到的错误

git 使用中遇到的错误

作者: 春阳_fc96 | 来源:发表于2019-01-16 11:32 被阅读0次

    1. git push 遇到 master branch has no upstream branch

    原因:没有将本地的分支与远程仓库的分支进行关联。

    解决:1. git push --set-upstream origin master

                2. git push -u origin master

    2. git pull 遇到 There is no tracking information for the current branch.

    原因:当前分支未找到跟踪

    解决:git pull origin master

    3. git pull origin master 遇到 refusing to merge unrelated histories

    原因:拒绝合并不相关的历史。这是因为两个分支没有取得关系,多数为本地直接关联远程库而不是clone下来

    解决:git pull origin master --allow-unrelated-histories

    4. git pull 遇到 Automatic merge failed; fix conflicts and then commit the result.

    原因:多人协作修改同一文件导致代码冲突。

    解决:如果是需要远程的代码 $:git reset --hard origin

                需要本地的代码,本地查看冲突的部分,处理完成后,重新 add 并执行上传流程

    5. iOS git提交时忽略更新的UserInterfaceState.xcuserstate文件

    git rm --cached xxx.xcworkspace/xcuserdata/xxx.xcuserdatad/UserInterfaceState.xcuserstate

    git commit -m"remove UserInterfaceState.xcuserstate"

    git push

    相关文章

      网友评论

          本文标题:git 使用中遇到的错误

          本文链接:https://www.haomeiwen.com/subject/mpnpdqtx.html