git merge tools

博客主要介绍了Git相关设置。包括在Windows下配置全局的merge工具和git diff工具,在Linux下设置meld,以及其他方法和使用方式;还阐述了设置当前分支和全局的提交日志模板,最后给出了相关链接。

git merge tools

1.window下设置
(1.)配置全局的merge工具

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd p4merge '$BASE $LOCAL $REMOTE $MERGED'
git config --global mergetool.p4merge.trustExitCode false

(2.)配置git diff工具

git config --global diff.tool p4merge
  git config --global difftool.p4merge.cmd p4merge '$LOCAL $REMOTE'

2.Linux下设置meld

git config --global merge.tool meld
git config --global difftool.meld.path "/usr/bin/meld"
git config --global diff.tool meld
git config --global mergetool.meld.path "/usr/bin/meld"

3.其他方法

vim ~/.gitconfig

[merge]
        tool = meld
[diff]
        tool = meld
[difftool "meld"]
        path = /usr/bin/meld 
[mergetool "meld"]
        path = /usr/bin/meld

4.使用

git difftool
git mergetool

Git提交日志模板设置

(1.)设置当前分支的提交模板

git config commit.template [模板文件名]   
git config commit.template gitcommit_template

(2.)设置全局的提交模板

git config --global commit.template [模板文件名]   
git config --global commit.template gitcommit_template

//设置文本编辑器
git config --global core.editor [编辑器名称] 
git config --global core.editor vim

相关链接

https://qidawu.github.io/2015/08/27/git-mergetool/https://juejin.im/post/6861074853450956808#heading-12

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值