你的 git 别名是什么?
介绍
我曾多次被要求分享我的.gitconfig
别名并复制它。
我使用 git 别名有两个原因:
- 提高生产力。
- 记住有趣的
git
命令并从中学习。
我的 Gitconfig
这些是我的~/.gitconfig
文件中包含的别名,供您参考:
[alias]
a = add .
aliases = config --get-regexp alias
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias.// -e s/\\ /\\ $(printf \"\\043\")--\\>\\ / | column -t -s $(printf \"\\043\") | sort -k 1
ap = add . -p
addups = remote add upstream
bd = branch -d
bi = bisect
bl = branch -l
blr = branch -a
br = branch -r
ca = commit -a
cam = commit -a -m
ci = commit -m
cia = commit --author='imjoseangel <anotheremail@example.com>' -m
cm = commit
co = checkout
colast = checkout -
comments = commit -m 📒Comments
count = rev-list --count devel
db = branch -D
forgetAbout = rm --cached
formatting = commit -m 💅Formatting
fp = fetch -p
grep = grep -F
laf = fsck --lost-found
last = log -1 HEAD
latest = log -5 --pretty --oneline
ls = ls-files --others --exclude-standard -z
mend = commit --amend
nb = checkout -b
op = gc --prune=now --aggressive
pdo = push -d origin
pf = push --force-with-lease
po = push origin
pou = push --set-upstream origin
pr = pull --rebase
pror = remote prune origin
prud = pull --rebase upstream devel
prum = pull --rebase upstream main
prune = remote update --prune
ptag = push origin --tags
ra = rebase --abort
rc = rebase --continue
refactor = commit -m 👷Refactor
remotes = remote -v
renb = branch -m
rh = reset --hard
rhh = reset --hard HEAD
ri = rebase -i upstream/devel
rim = rebase -i upstream/main
rl = reflog
rp = repack -ad
s = status -s
search = rev-list --all
sh = show
short = shortlog -sn
sign = commit --amend --no-edit --signoff
st = status
stashes = stash list
tests = commit --allow empty -m ✅Tests
tuto = help tutorial
tuto2 = help tutorial-2
unstash = stash pop
vc = clean -dfx
wow = log --all --graph --decorate --oneline --simplify-by-decoration
git alias
添加后运行.gitconfig
会显示所有别名的列表作为参考列表。
要获取更多信息,只需运行git help <command or alias>
。例如:
git help st
'st' is aliased to 'status'
git help status
我发现有两个别名对初学者来说很有趣:
git tuto
git tuto2
我们始终欢迎以不同方式提出意见和建议。
文章来源:https://dev.to/imjoseangel/what-are-your-git-aliases-43om