git bash 设置别名_使用Git设置分支别名

git bash 设置别名

Version control systems can be difficult to use, especially when you don't use a UI app. Just think about main branch or revision names: svn uses "trunk", git uses "master", and mercurial (hg) uses "tip". I need to switch between mercurial and git frequently, so I end up reversing command and branch names constantly.

版本控制系统可能难以使用,尤其是当您不使用UI应用程序时。 只需考虑主分支或修订版本名称:svn使用“ trunk”,git使用“ master”,而Mercurial(hg)使用“ tip”。 我需要经常在mercurial和git之间切换,因此最终会不断反转命令和分支名称。

To set a git branch alias, execute the following:

要设置git分支别名,请执行以下操作:

# alias -> real branch
git symbolic-ref refs/heads/trunk refs/heads/master

With the alias in place, you can execute commands like:

使用别名后,您可以执行以下命令:

git checkout trunk
git branch # * master

Not only can you create git aliases for commands, but you can create aliases for branches!

您不仅可以为命令创建git别名 ,还可以为分支创建别名!

翻译自: https://davidwalsh.name/set-branch-alias-with-git

git bash 设置别名

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值