git的配置文件

时间:2022-11-26 15:30:38

cat ~/.gitconfig       #git 的配置

git help xx      #查看帮助文档

[alias]

st = status  --short --branch

# 增加commit

ci = commit -a -v -s 

# 合并改过的内容

cm = commit -a --amend -C HEAD

#在commit的基础上修改commit

ca  = commit --amend

# switch to branch

co = checkout -b

#only create a new brach

br= branch

bv = branch -vv

ba = branch -ra

#delete the branch

db = branch -d

df = diff

dc = diff --cached

lg = log -p     #git log lg ./  查看当前log的详细信息

lf = log --stat

last = log -1 HEAD   #查看最近的log

#以某种格式列出log

ll = log --pretty=format:"%C(yellow)"...

ld = log --pretty=format:"%C(yellow)%h\\"

ls = log....

lo = log --oneline

#删除log中的第一个commit

un = reset --hard  HEAD

uh = reset --hard HEAD^

aa = add --all

mm = merge --no-ff

pu = push --tags

pl = pull ---rebase