GIT Configuration

本文介绍了如何配置GitforWindows,包括设置用户信息、别名等,并详细说明了如何配置KDiff3作为合并和差异工具。
既然安装了GIT for Windows, 那免不了需要配置一下. 这里backup自己的configuration.

配置的命令比如:
$ git config --global user.name "Zhang San"
$ git config --global user.email "zhangsan.android@gmail.com"
$ git config --global alias.ci commit


[b]配置KDiff3作为merge tool和diff tool[/b]
1.
下载KDiff3 ([url]http://sourceforge.net/projects/kdiff3/[/url])并且安装.

2.
$ git config --global merge.tool kdiff3
$ git config --global meregtool.kdiff3.path "C:/Program Files (x86)/KDiff3/kdiff3.exe"


3.
然后启动gitk GUI界面
$ gitk
在Edit->Preferences->External diff tool输入"C:/Program Files (x86)/KDiff3/kdiff3.exe"

下面我的.gitconfig文件, backup一下
[alias]
ci = commit
co = checkout
st = status
br = branch
oneline = log --pretty=oneline --since='2 days ago'
onelog = log -p -1

[user]
name = Zhang San
email = zhangsan.android@gmail.com

[color]
diff = auto
status = auto
branch = auto
ui = auto

[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files (x86)/KDiff3/kdiff3.exe
$ git lfs install --global Error: unknown flag: --global git lfs install [options] Perform the following actions to ensure that Git LFS is setup properly: * Set up the clean and smudge filters under the name "lfs" in the global Git config. * Install a pre-push hook to run git lfs pre-push for the current repository, if run from inside one. If "core.hooksPath" is configured in any Git configuration (and supported, i.e., the installed Git version is at least 2.9.0), then the pre-push hook will be installed to that directory instead. Options: Without any options, git lfs install will only setup the "lfs" smudge and clean filters if they are not already set. --force: Sets the "lfs" smudge and clean filters, overwriting existing values. --local: Sets the "lfs" smudge and clean filters in the local repository's git config, instead of the global git config (~/.gitconfig). --worktree: Sets the "lfs" smudge and clean filters in the current working tree's git config, instead of the global git config (~/.gitconfig) or local repository's git config ($GIT_DIR/config). If multiple working trees are in use, the Git config extension worktreeConfig must be enabled to use this option. If only one working tree is in use, --worktree has the same effect as --local. This option is only available if the installed Git version is at least 2.20.0 and therefore supports the "worktreeConfig" extension. --manual: Print instructions for manually updating your hooks to include git-lfs functionality. Use this option if git lfs install fails because of existing hooks and you want to retain their functionality. --system: Sets the "lfs" smudge and clean filters in the system git config, e.g. /etc/gitconfig instead of the global git config (~/.gitconfig). --skip-smudge: Skips automatic downloading of objects on clone or pull. This requires a manual "git lfs pull" every time a new commit is checked out on your repository. --skip-repo: Skips installation of hooks into the local repository; use if you want to install the LFS filters but not make changes to the hooks. It is valid to use --local, --global, or --system in conjunction with this option.
最新发布
07-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值