不能推,拉或合并git。 “工作副本有未改变的更改” [英] Cannot push, pull or merge git. "Working copy has uncommited changes"

查看:195
本文介绍了不能推,拉或合并git。 “工作副本有未改变的更改”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在bitbucket上建立了一个git仓库,并在其上添加了一个旧项目。我已经承诺并推出了一项测试,但现在我面临这个问题。



每次尝试Pull,Push或Merge时都会收到以下错误消息:




工作副本'Project_Name'有未提交的更改。



几次:






编辑:我做了'git status',得到了以下结果:

 #在分支master上
#您的分支在2次提交之前超过'origin / master'。

#没有为commit提交更改:
#(使用git add< file> ...更新将提交的内容)
#(使用git checkout - < file> ...放弃工作目录中的更改)

#modified:Crunch.xcodeproj / project.xcworkspace / xcuserdata / Neil.xcuserdatad / UserInterfaceState.xcuserstate

未提交更改(使用git add和/或git commit -a)






帮助将不胜感激,SirKaydian

解决方案

步骤1:

  git rm --cached ProjectName.xcodeproj / project.xcworkspace / xcuserdata / username.xcuserdatad / UserInterfaceState.xcuserstate $ b第二步:

 <$> c $ c> git commit -m删除不应该被跟踪的文件


I have recently set up a git repository on bitbucket, and have added an old project onto it. I have committed and pushed a change as a test, but now I face this problem.

Each time I try to Pull, Push, or Merge I get this error message:

"The working copy 'Project_Name' has uncommitted changes".

And I have committed this change several times:


EDIT: I did 'git status' and got the following:

# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   Crunch.xcodeproj/project.xcworkspace/xcuserdata/Neil.xcuserdatad/UserInterfaceState.xcuserstate
#
no changes added to commit (use "git add" and/or "git commit -a")


Help would be greatly appreciated, SirKaydian

解决方案

Step 1:

git rm --cached ProjectName.xcodeproj/project.xcworkspace/xcuserdata/username.xcuserdatad/UserInterfaceState.xcuserstate

Step 2:

git commit -m "Removed file that shouldn't be tracked"

这篇关于不能推,拉或合并git。 “工作副本有未改变的更改”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆