markdown 添加别名bash和git别名

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 添加别名bash和git别名相关的知识,希望对你有一定的参考价值。

For your alias to be insert in commands bash, you need to include that in .bashrc, 
so take this example and to be happy:

```echo alias g=\'git\' >> .bashrc```

If you have a success with this command, you can now call git with 'g' command.

Now, if you like alias git, you can create your personal alias file, take this 
example and edit your file ~ / .gitconfig:

```
[user]
	email = mikaelhadler@gmail.com
	name = Mikael Hadler
[core]
	editor = nano
[alias]
	st = status
	ac = !git add -A && git commit
	ck = checkout
	cb = checkout -b
	cm = commit
	b = branch
	revert = reset --hard HEAD~1
	del = branch -D
	l=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

```

以上是关于markdown 添加别名bash和git别名的主要内容,如果未能解决你的问题,请参考以下文章

markdown Bash / zsh中的别名

别名 g='git' 并且 bash 完成仍然有效 [重复]

git别名可以像bash别名一样扩展吗?

bash别名中的Git自动完成?

git-bash的alias别名设置

如何将 bash 脚本直接嵌入到 git 别名中