[英]How can I find my alias for `git log`?
I have my git log formatted a specific way, which works when I call git lg
(note the lack of an o) and it looks quite nice. 我的git日志格式化了一种特定的方式,当我调用
git lg
(注意缺少一个o)它看起来很不错。 I got it from a stackoverflow answer and all I had to do was enter something in the command line, like git config ...
or something, and voila, git lg worked. 我从stackoverflow的答案得到它,我所要做的就是在命令行输入一些东西,比如
git config ...
或者其他东西,瞧,git lg工作了。
However, I'm on a new computer now and I want that to work again. 但是,我现在正在使用新计算机,我希望它再次运行。 How do I get what git lg is mapped to?
我如何获得git lg映射到的内容?
This will output the alias: git config alias.lg
这将输出别名:
git config alias.lg
In general, you can get at an alias with git config alias.<alias>
. 通常,您可以使用
git config alias.<alias>
来获取git config alias.<alias>
。 You could also look in the .gitconfig
file and copy its contents, although the git config
command is probably easier. 您也可以查看
.gitconfig
文件并复制其内容,尽管git config
命令可能更容易。
Also, I strongly suspect this was your alias . 另外,我强烈怀疑这是你的别名 。 The original is here but is throwing a 500 error for me right now (archived on archive.org ) .
原文在这里但是现在给我丢了500个错误(存档在archive.org上 )。 For folks to lazy to click the links:
对于懒惰的人来说,点击链接:
log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.