git 在 Android Studio GUI 中显示所有冲突文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46178612/
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
Show all conflicting files in Android Studio GUI
提问by lidkxx
Is there a way to show all conflicting files in Android Studio? I am thinking of some view/list that will only show the conflicting ones.
有没有办法在 Android Studio 中显示所有冲突的文件?我正在考虑一些只会显示冲突的视图/列表。
Currently I am finding them manually by looking into terminal output after running git merge
and opening the ones that were not auto-merged one by one.
目前,我通过在运行git merge
并打开未一一自动合并的那些后查看终端输出来手动找到它们。
回答by Marina Liu
You can merge branches by the option in Android Studio -> VCS -> Git -> merge changes.
您可以通过 Android Studio -> VCS -> Git -> 合并更改中的选项合并分支。
Then you will get the files with conflicts.
然后你会得到有冲突的文件。
If you close the merge conflicts windows, you can also get the list of conflict files under the vseriojn control Tab.
如果关闭合并冲突窗口,还可以在 vseriojn 控制选项卡下获取冲突文件列表。
回答by YoannFleuryDev
In Android Studio, you can go to VCS > Git > Resolve conflicts. It will show you all the conflicting files and you can select what to keep and what to drop with a great GUI. Hope it's the answer you were looking for.
在 Android Studio 中,您可以转到 VCS > Git > 解决冲突。它将向您显示所有冲突文件,您可以使用出色的 GUI 选择要保留的内容和删除的内容。希望这是您正在寻找的答案。
回答by Tim Biegeleisen
This is a good question, and I would have also gone the route you did, namely opening the Git bash doing git status
. I don't know of a direct way to get a list of all files in conflict, but there is a proxy which should work equally well. Simply do a find in all source files for anyone of the following three merge conflict markers:
这是一个很好的问题,我也会按照你的方式去做,即打开 Git bash 做git status
. 我不知道获取所有冲突文件列表的直接方法,但有一个代理应该同样有效。只需在所有源文件中查找以下三个合并冲突标记中的任何一个:
>>>>>>>
=======
<<<<<<<
Ideally your source files won't contain these markers unless Git just put them there. At the bottom of Android studio you should have a list of matching files which should also be the list of files which have merge conflicts.
理想情况下,您的源文件不会包含这些标记,除非 Git 只是将它们放在那里。在 Android Studio 的底部,您应该有一个匹配文件列表,它也应该是具有合并冲突的文件列表。
There may be a more direct way to do this in Android Studio, but this trick might be very helpful to someone using a less heavyweight IDE like Sublime.
在 Android Studio 中可能有一种更直接的方法来做到这一点,但这个技巧对于使用像 Sublime 这样重量级不那么重的 IDE 的人来说可能非常有帮助。