xcode 如何忽略 MAC 的 Github gui 中未提交的更改?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11385189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to ignore uncommited change in Github gui for MAC?
提问by ttotto
I am using Github GUI for Mac. Now I've some changes in my local repository, but I want to ignore them and pull latest remote repository. I tried Repository/Pull, but got Git Error.
我正在为 Mac 使用 Github GUI。现在我的本地存储库中有一些更改,但我想忽略它们并拉取最新的远程存储库。我尝试了 Repository/Pull,但遇到了 Git 错误。
"?error: Your local changes to the following files would be overwritten by merge: Classes/xxx.m Please, commit your changes or stash them before you can merge."
“?错误:您对以下文件的本地更改将被合并覆盖:Classes/xxx.m 请在合并之前提交您的更改或隐藏它们。”
I tried Repository/Synchronize, but got following error.
我尝试了存储库/同步,但出现以下错误。
"Sync Failed. Please commit all your changes before syncing."
“同步失败。请在同步前提交所有更改。”
Any idea?
任何的想法?
采纳答案by Leo wang
If you mean using MAC GUI only, check and right click the changed files then select the discard the changes.
如果您的意思是仅使用 MAC GUI,请检查并右键单击更改的文件,然后选择放弃更改。
回答by user01380121
Place a checkmark near each of the changed files, then go to the Repository menu and click Discard Changes to Selected Files.
在每个已更改的文件附近打勾,然后转到“存储库”菜单并单击“放弃对选定文件的更改”。
回答by Evert
if you want to remove your uncommitted changes, just do a checkout on those files again.
如果要删除未提交的更改,只需再次签出这些文件即可。
Stash is super easy too though, and it keeps your changes in a local 'bucket' or stash :)
不过,Stash 也非常简单,它将您的更改保存在本地“存储桶”或存储中 :)
回答by micstr
For those on Github for Windows, it is not obvious where Discard All Changes is, so I wanted to share this:
对于Github for Windows 上的人来说,Discard All Changes 在哪里并不明显,所以我想分享一下:
- Select Files by using check mark next to names.
- Right click on Collapse All/ Expand All button with two arrows. (This button is on right side of Files to Commit box, and under Sync and Gear icons.) This is where Discard All Changes is >hidden<.
- 使用名称旁边的复选标记选择文件。
- 右键单击带有两个箭头的全部折叠/全部展开按钮。(此按钮位于“要提交的文件”框的右侧,以及“同步”和“齿轮”图标下。)这是“放弃所有更改”>隐藏<的地方。
Sorry but too low level to add comment to @Leo wangs or @aspiringwebdev chain above. You gotta start somewhere...
抱歉,但级别太低,无法向上面的 @Leo wangs 或 @aspiringwebdev 链添加评论。你必须从某个地方开始......