Xcode:“工作副本____有未提交的更改";与git状态:“什么也没提交,工作目录干净" [英] Xcode: "The working copy ____ has uncommitted changes" vs. git status: "nothing to commit, working directory clean"

查看:78
本文介绍了Xcode:“工作副本____有未提交的更改";与git状态:“什么也没提交,工作目录干净"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode 5.0.2中,我尝试从远程拉出并收到以下消息:

In Xcode 5.0.2, I try to pull from a remote and am given the following message:

工作副本项目名称"具有未提交的更改.提交或放弃更改,然后重试."

"The working copy 'project-name' has uncommitted changes. Commit or discard the changes and try again."

足够公平.我拉出提交对话框,然后收到消息此文件在所请求的版本中不存在".单击确定"将我带入提交对话框.(在右窗格中未显示任何修订,大概是出于与我收到最新消息相同的原因.)选择平面视图后,我看到只有一个修改后的文件: project.pbxproj .我输入提交消息,然后单击提交1个文件".然后,当我去拉时,我发现自己的位置与以前完全相同-出现相同的消息,并且无论我进行多少次提交,我都无法拉(或推).

Fair enough. I pull up the commit dialog, and am then given the message, "This file does not exist at the requested revision." Clicking 'OK' brings me on into the commit dialog. (There is no revision displayed in the right pane, presumably for the same reason I was given the most recent message.) Selecting the flat view, I see that there is only one modified file: project.pbxproj. I enter a commit message and click 'Commit 1 File'. When I then go to pull, I find that I am in exactly the same position as before--the same messages appear and I am unable to pull (or push) no matter how many times I make a commit.

很好奇,我运行 git diff 来查看 just 发生了什么变化.没有什么. git status 为我提供了同样有用的输出:什么都不提交,工作目录很干净.是 git push 还是 git pull ?是的,这些命令在命令行上就可以正常工作.

Curious, I run git diff to see just what has changed. Nothing. git status provides me with equally helpful output: nothing to commit, working directory clean. git push or git pull? Yep, those work just fine from the command line.

那有什么用呢?为什么Xcode坚持要求我在工作目录中进行更改?为什么不告诉我它们是什么?尝试重新启动Xcode和系统.虽然我很高兴我仍然可以使用 的方式进行推送和拉取,但是如果Xcode git集成表现良好,那将是非常不错的.有什么想法吗?

So what gives? Why does Xcode insist that I have changes in my working directory? Why won't it tell me what they are? Have tried restarting Xcode and system. While I'm happy that I still have some way to push and pull, it would be really nice if the Xcode git integration was behaving nicely. Any ideas?

我发现了这些类似的问题,但没有一个解决这个特定的问题(或提供可接受的解决方案):

I've found these similar questions, but none address this particular issue (or provide an acceptable solution):

推荐答案

好的,所以我解决了我的问题.

Okay, so I fixed my issue.

打开Xcode:

  1. 打开终端-cd/到您的项目目录.
  2. 键入:" git reset --hard "
  3. 键入 git status

重新启动Xcode并进行提交(只需输入注释或类似内容)

Restart Xcode and make a commit (Just a comment or something )

重复上述步骤.

这为我解决了我的问题.

This sorted out my issue for me.

这篇关于Xcode:“工作副本____有未提交的更改";与git状态:“什么也没提交,工作目录干净"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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