msysgit多命令别名

时间:2010-11-08 13:14:51

标签: git msysgit

我正在尝试在我的.gitconfig中添加一个多命令git别名:YUI Gallery Doc

我正在使用msysgit bash shell中的git。 doc中的命令都不适用于我:

[aliases]
    pu = !"git fetch origin -vn git fetch upstream -vn git merge upstream/master"

给出:

$ git pu
Enter passphrase for key '/c/Users/mjhm/.ssh/id_rsa':
fatal: Couldn't find remote ref git

然而

[alias]
    pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"

给出:

$ git pu
error: unknown switch `;'
usage: git fetch [<options>] [<repository> [<refspec>...]]
...

如何在msysgit中使用多命令别名?

1 个答案:

答案 0 :(得分:3)

Yahoo UI文档似乎使用了一种链接git命令的方法,这种命令与documented by git不同。

通过应用该逻辑,我将使用以下行:

pu = ! git fetch origin -v && git fetch upstream -v && git merge upstream/master

(我相信在Windows版本中,“n”应该是“\ n”。但是这不能用于msysgit bash - 也许这可以从cmd.com开始工作)