【问题标题】:git merge -Xignore-space-change by defaultgit merge -Xignore-space-change 默认
【发布时间】:2014-07-15 02:53:29
【问题描述】:

如何使用git config为所有合并设置选项ignore-space-change

我或许可以在merge 上使用别名,但由于我希望该设置适用于git stash popgit stash applygit pullgit merge 以及其他如果有的话,我想要一个清洁器比设置许多别名的方式(我什至不知道我是否可以为子命令设置别名stash)。

我查看了文档,但找不到要使用的配置选项。

【问题讨论】:

标签: git merge git-merge git-config


【解决方案1】:

每个分支:

git config branch.$branchname.mergeoptions "-X ignore-space-change"

通过扫描the git config docs 找到“合并”。如果有一个全局选项设置器我看不到它,一个 git 别名可能会这样做:

git config alias.i-s-c-merge "merge -X ignore-space-change"

我认为现在每个 shell 在 git 命令上都有制表符补全,所以它是 git i- 和制表键而不是空格键。

【讨论】:

  • 这会影响哪个分支?如果我在master 上设置了mergeoptions,并想将new_feature 合并到其中,我需要masternew_feature 上的设置,还是两者都需要?
猜你喜欢
  • 1970-01-01
  • 2011-11-10
  • 1970-01-01
  • 2012-07-21
  • 2011-07-28
  • 2014-03-06
  • 1970-01-01
  • 1970-01-01
  • 2023-03-20
相关资源
最近更新 更多