git config配置文件
Git有一個工具被稱為git config,它允許你獲得和設置配置變量;這些變量可以控制Git的外觀和操作的各個方面。這些變量可以被存儲在三個不同的位置:?
---------------------------------------------------------
1./etc/gitconfig?文件:包含了適用于系統所有用戶和所有庫的值。如果你傳遞參數選項’--system’?給?git config,它將明確的讀和寫這個文件。?
2.~/.gitconfig?文件 :具體到你的用戶。你可以通過傳遞--global?選項使Git?讀或寫這個特定的文件。
3.位于git目錄的config文件?(也就是?.git/config)?:無論你當前在用的庫是什么,特定指向該單一的庫。每個級別重寫前一個級別的值。因此,在.git/config中的值覆蓋了在/etc/gitconfig中的同一個值。
---------------------------------------------------------
vi?~/.gitconfig
1 [user]
2 name = zhe.jxxxg
3 email = zhe.jxxxg@sixxxtech.com
4 [color]
5 ui = true
6 [core]
7 editor = vim
8
9 [alias]
10 co = checkout
11 ci = commit
12 st = status
13 br = branch -v
14 rt = reset --hard
15 unstage = reset HEAD^
16 uncommit = reset --soft HEAD^
17 l = log --pretty=oneline --abbrev-commit --graph --decorate
18 amend = commit --amend
19 who = shortlog -n -s --no-merges
20 g = grep -n --color -E
21 cp = cherry-pick -x
22 nb = checkout -b
23
24 #'git add -u' handles deleted files, but not new files
25 #'git add .' handles any current and new files, but not deleted
26 #'git addall' noe handles all changes
27 addall = !sh -c 'git add . && git add -u'
28
29 #Handy shortcuts for rebasing
30 rc = rebase --continue
31 rs = rebase --skip
32 ra = rebase --abort
轉載于:https://www.cnblogs.com/yangtze736-2013-3-6/p/3530890.html
總結
以上是生活随笔為你收集整理的git config配置文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iOS 无限后台运行
- 下一篇: linux 之进程间通信--------