Git in netbeans - 解决冲突 [英] Git in netbeans - resolving conflicts
问题描述
我在netbeans中使用Git,我想提交我的更改,但首先我做了一次拉,现在有冲突。
在左边,我有一个.java类由于冲突而呈红色,我右键单击它并选择Resolve Conflicts,然后执行这些步骤。
但它仍然不会让我承诺。我想用我的代码覆盖当前的HEAD修订版,但是它不会让我提交。我该怎么做呢?
当我选择文件并选择查看Git - > Diff时,它只允许我用工作副本中的代码替换或删除HEAD中的代码,而不是替换HEAD中的代码。
基本上,我想提交我的代码,而不是还原等。我如何在netbeans中执行此操作?它一直告诉我我不能提交,因为冲突。
我刚解决了我的问题,希望它有帮助。
-
1)更新到NetBeans 7.1.2 IDE,重新启动新的IDE。 - 2)打开Git Repository Browser(使用一个(no分支)本地分支)并切换到分支,同时出现Team菜单下的问题(它将被标记为不分支默认情况下,检查长Md5总和是相同的。)
- 3)从其他分支中提取其他需要的代码(如果需要的话,我不得不在我的情况下) 。
- 4)现在编辑/粘贴您要覆盖的代码。 (这会将文件名变为红色字体)。
- 5)简单地右键单击文件,Git> Resolve Conflicts(它会发挥它的魔力并将文件名转换为蓝色字体)。
-
6)提交本地分支并完成。
I am using Git in netbeans and I wanted to commit my changes, however first I did a pull, and now there are conflicts.
On the left, I have a .java class that is in red because of conflicts, and I've right clicked it and selected Resolve Conflicts, and went through those steps.
But it still won't let me commit. I would like to override the current HEAD revision with my code, however it won't let me commit. How do I do this?
And when I select the file and choose to see Git -> Diff, it only lets me replace or delete the code in my working copy with the code from the HEAD, rather than replace the code in the HEAD.
Basically, I want to commit my code, not revert, etc. How do I do this in netbeans? It keeps telling me I cannot commit because of conflicts.
I just solved my issue, hope it helps.
- 1) Updated to Netbeans 7.1.2 IDE, restarted new IDE.
- 2) Open Git Repository Browser (used a (no branch) local branch) and switch to the branch with the issues both under the Team menu (it will be marked as a no-branch by default, check for the long "Md5 sum" to be the same).
- 3) Pull other needed code from other branches (in case its needed, I had to in my case).
- 4) Now edit/paste the code you want to overwritte. (This will turn the filename to red font).
- 5) Simply right click the file, Git>Resolve Conflicts (and it will do its magic and turn the filename to blue font).
- 6) Commit your local branch and finish.
这篇关于Git in netbeans - 解决冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!