mergetool

What should I do when git revert aborts with an error message?

一个人想着一个人 提交于 2019-12-17 16:24:32
问题 OK, so I'm getting an error sometimes when I try to revert a commit (with Git). All that I do is git revert <commit hash> and it gives me this message: error: could not revert <commit hash> <commit message> hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' Does this mean that I should use git mergetool and resolve any conflicts? Once I do this can I add/rm and then commit, and the revert is complete? 回答1: Yes you will have to

git cherry-pick: how consider only lines modified by the commit (i.e., not the surrounding context)?

狂风中的少年 提交于 2019-12-11 02:49:30
问题 I have a project with two branches: D---E branch1 / ---A---C branch2 I want to apply commit E (but not D) on top of branch2. I used git cherry-pick and git mergetool (with meld ) for resolving conflicts. So far, so good. However, suppose that the state of the file after commit C is lineC1 <context C> lineC2 and the change introduced by commit E is -lineC1 +lineE1 <context E> -lineC2 +lineE2 I would expect the result shown by default by the mergetool to be lineE1 <context C> lineE2 (i.e.,

How to use different merge and diff tool in git?

对着背影说爱祢 提交于 2019-12-09 23:45:19
问题 I prefer to use meld as the diff tool. However it doesn't have an option to quickly solve all simple conflicts so in case of merging I'd like to use kdiff3 I've set merge.tool to kdiff3 and diff.guitool to meld but git difftool still always run kdiff3 [merge] tool = kdiff3 conflictstyle = diff3 [diff] guitool = meld renames = copies mnemonicPrefix = true [difftool] prompt = false How to make git difftool run meld ? 回答1: diff.guitool only applies if you use the --gui flag. Setting diff.tool

Using IntelliJ as git mergetool always exits as soon as soon as it starts

孤人 提交于 2019-12-09 15:19:06
问题 I have configured IntelliJ as my diff and mergetool on my mac, but the git launches it, the command line always returns immediately, rather than waiting for the diff to be completed, which means that the changes enacted are not reflected on disk. My configuration is: [mergetool "intellij"] cmd = /Applications/IntelliJ\\ IDEA\\ 13\\ CE.app/Contents/MacOS/idea merge \ $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") \ $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") \ $(cd $

Git: configure patterns for difftool and mergetool

青春壹個敷衍的年華 提交于 2019-12-09 12:44:21
问题 In Mercurial, one can define a pattern for external diff and merge tools (so that they are called only for files matching the pattern specified): [diff-patterns] **.ext = difftool [merge-patterns] **.ext = mergetool How to define such patterns in Git? [mergetool] section in git-config(1) does not mention any pattern, mask or anyting similar. EDIT : Here is a relevant part of my .git/config: [diff] tool = difftool [difftool "difftool"] cmd = difftool.git.sh "$LOCAL" "$REMOTE" "$BASE" [merge]

How to use Beyond Compare 3 as external SVN (SlikSVN) merge and diff tool on Windows?

余生颓废 提交于 2019-12-08 13:12:50
问题 I want to configure SVN command line client SlikSVN with Beyond Compare 3 as external diff and merge tool. How to do this? 回答1: Add Beyond Compare 3 folder to Windows PATH . If you don't know how check this answer - just replace Python path with Beyond Compare 3 path. In Beyond Compare 3 folder create bcomp-diff.bat file: @ECHO OFF SET DIFF="bcomp.exe" SET LEFT=%6 SET RIGHT=%7 %DIFF% %LEFT% %RIGHT% In Beyond Compare 3 folder create bcomp-merge.bat file: @ECHO OFF SET DIFF3=BComp.exe SET BASE=

How to perform a 3-way visual diff on git?

蓝咒 提交于 2019-12-08 05:17:13
问题 I'd like to do a 3-way diff of a single file that exist in 2 different branches, that is, the last commit in each branch and also consider the common ancestor. I want to use an external tool that allows to do 3-way comparison. I was considering to use git difftool but as far as I could see it only allows comparing any 2 versions of a given file. I could use mergetool but that forces me to run git merge first so that, BASE, REMOTE and LOCAL variables are set. I don't want to run git merge. I

View full file diff of `x` commits of a single file's history (that's hosted in git)

£可爱£侵袭症+ 提交于 2019-12-07 10:03:53
问题 Say I have a file in git called filex.code , and I want to see the full code of the last x versions of that file with each changed section highlighted -- all in one place. So an x -paned commit history of filex.code , almost as if I were doing an x -paned diff, but viewing historical versions rather than merging from different branches. The greater x , the better. Crossplatform would be great, but any of the Big Three works. Being able to edit the latest version would also be great, but read

View full file diff of `x` commits of a single file's history (that's hosted in git)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 13:54:42
Say I have a file in git called filex.code , and I want to see the full code of the last x versions of that file with each changed section highlighted -- all in one place. So an x -paned commit history of filex.code , almost as if I were doing an x -paned diff, but viewing historical versions rather than merging from different branches. The greater x , the better. Crossplatform would be great, but any of the Big Three works. Being able to edit the latest version would also be great, but read-only visualization is plenty. Note that this is different from a simple history of commits to a file,

How to skip “Hit return to start merge resolution tool” and open mergetool automatically

ぐ巨炮叔叔 提交于 2019-12-05 07:03:23
Git asking to hit return button to open the mergetool for each conflict file one by one: > git mergetool Normal merge conflict for '...': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (opendiff): How can I avoid the hitting return step for my project and just open the configured merge tool automatically? Use the -y flag. From the documentation : -y --no-prompt Don’t prompt before each invocation of the merge resolution program. To permanently skip the prompt, run: git config --global mergetool.prompt false To skip it for a single run of git mergetool