1

我在 git 中使用了 mergetool,它会弹出我喜欢的 opendiff。我查看更改并选择应该去哪里。我点击“保存”然后回头看看终端。它要求我Was the merge successful? [y/n]回答是,但我不知道怎么说“使用我刚刚保存的新合并文件!不是他们的,不是我们的,而是我刚刚保存的那个”

Normal merge conflict for 'www/httpdocs/manifest/subsectionmanager-storage':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (opendiff): 
www/httpdocs/manifest/subsectionmanager-storage seems unchanged.
Was the merge successful? [y/n] y

Normal merge conflict for 'www/httpdocs/workspace/themes/active/less/common.less':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (opendiff): 
www/httpdocs/workspace/themes/active/less/common.less seems unchanged.
Was the merge successful? [y/n] ^[[A
www/httpdocs/workspace/themes/active/less/common.less seems unchanged.
Was the merge successful? [y/n] y
kirkstrobeck:atheycreek kirkstrobeck$ git add .
kirkstrobeck:atheycreek kirkstrobeck$ git add -u
kirkstrobeck:atheycreek kirkstrobeck$ git commit -m 'merged'
[master f6fed72] merged
 12 files changed, 1330 insertions(+), 29 deletions(-)
 mode change 100644 => 100755 www/httpdocs/workspace/data-sources/data.status_all_entries.php
 mode change 100644 => 100755 www/httpdocs/workspace/data-sources/data.twitter.php
 mode change 100644 => 100755 www/httpdocs/workspace/data-sources/data.twitter_latest_entry.php
 create mode 100755 www/httpdocs/workspace/themes/active/less/common.less.orig
 mode change 100644 => 100755 www/httpdocs/workspace/uploads/members/photos/amy_mcreynolds-4fb2e70566fb9.jpg
 mode change 100644 => 100755 www/httpdocs/workspace/uploads/members/photos/rachel-4fb2e793b13bd.jpg
 mode change 100644 => 100755 www/httpdocs/workspace/uploads/members/photos/tim-4fb3da80b15e3.jpg
 mode change 100644 => 100755 www/httpdocs/workspace/xml-importers/xml-importer.twitter.php
 mode change 100644 => 100755 www/httpdocs/workspace/xml-importers/xml-importer.ustream.php
 mode change 100644 => 100755 www/httpdocs/workspace/xml-importers/xml-importer.vimeo.php
 mode change 100644 => 100755 www/mysql/atheycreek_2012-05-16.sql
kirkstrobeck:atheycreek kirkstrobeck$ git stash apply
Auto-merging www/httpdocs/workspace/themes/active/less/common.less
CONFLICT (content): Merge conflict in www/httpdocs/workspace/themes/active/less/common.less
Auto-merging www/httpdocs/manifest/subsectionmanager-storage
CONFLICT (content): Merge conflict in www/httpdocs/manifest/subsectionmanager-storage
kirkstrobeck:atheycreek kirkstrobeck$ 

kirkstrobeck:atheycreek kirkstrobeck$ git config --global --list
user.name=kirkstrobeck
user.email=kirk@strobeck.com
user.user=kirkstrobeck
user.token=fd0010cb7e13a3f9bafe9766cfa81e7c
core.editor=nano
core.excludesfile=/Users/kirkstrobeck/.gitignore_global
github.user=kirkstrobeck
github.token=fd0010cb7e13a3f9bafe9766cfa81e7c
difftool.sourcetree.cmd=/Applications/Kaleidoscope.app/Contents/MacOS/ksdiff -w "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
difftool.Kaleidoscope.cmd=ksdiff-wrapper git "$LOCAL" "$REMOTE"
difftool.prompt=false
diff.tool=Kaleidoscope
mergetool.keepbackup=true
kirkstrobeck:atheycreek kirkstrobeck$ 
4

2 回答 2

2

听起来好像opendiff在 git 中没有正确配置。您应该在您的

git config mergetool.<tool>.trustExitCode true

如果自定义合并工具通过其退出代码正确指示合并解析成功,则可以将配置变量 mergetool..trustExitCode 设置为 true。否则,git-mergetool 会在自定义工具退出后提示用户指示解析成功。

http://www.kernel.org/pub/software/scm/git/docs/v1.7.3/git-mergetool.html

于 2012-05-18T16:55:24.987 回答
1

您需要运行以下命令才能接受合并的结果作为要使用的新代码:

git config --global mergetool.[tool].trustExitCode true
于 2012-09-27T02:01:04.030 回答