git创建仓库别名_创建Git别名

git创建仓库别名

I create shortcuts for everything. I create variables which act as text shortcuts, shortcuts in TextMate to generate CSS/JS/HTML, and bash scripts so I don't have to type in the same commands over and over again. So why should version control software be any different? I commit and push religiously so I create Git aliases to save myself a few keystrokes.

我为所有内容创建快捷方式。 我创建了用作文本快捷方式的变量,TextMate中用于生成CSS / JS / HTML的快捷方式以及bash脚本的变量,因此我不必一遍又一遍地键入相同的命令。 那么为什么版本控制软件应该有所不同呢? 我虔诚地承诺并推动,所以我创建了Git别名以节省一些击键。

样本别名 (Sample Aliases)


#make "com" alias for "commit"
git config alias.com commit

#make "co" alias for checkout
git config alias.co checkout

#make "br" alias for branch
git config alias.br branch

# When you want to see just the differences of one function in one file in two different commits
git config alias.funcdiff '!sh -c "git show \"\$1:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp1 &&
        git show \"\$2:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp2 &&
        git diff --no-index .tmp1 .tmp2"' -



These are just some sample Git aliases. You can view more detailed (and by detailed I mean brain-numbing) examples of git aliases at the Git Wiki.

这些只是一些示例Git别名。 您可以在Git Wiki上查看git别名的更多详细示例(我指的是使人麻木)。

翻译自: https://davidwalsh.name/git-aliases

git创建仓库别名

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值