2013-06-19 49 views
3

我正在通过gitimmersion和创建别名[复数]。一切工作,除了我的历史。Git Hist别名问题

$ git config --global alias.hist log --pretty=format: '%h %ad | %s%d [%an]' --graph --date=short 

这需要我去的.config页面,但不创建一个别名

我知道代码工作(即我正在为一个别名的部分),当我运行

因为
$ git log --pretty=format: '%h %ad | %s%d [%an]' --graph --date=short 

它执行我想要的任务。

制作别名工作

回答

6

任何想法,你需要一些""那里得到的一切,通过正确地传递:

git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" 

另外,我觉得你有format:和格式字符串之间的额外空间在你的两个例子中。

+0

哪里是你的第二个 “?”如果我输入你想要的更多代码,请输入> – IdeoREX

+0

在log之前有一个代码,在行末有一个代码。我不确定我是否理解这个问题。 –

+0

我运行$ git hist |||时收到错误返回|||致命的:模棱两可的论点“:未知的版本或路径不在工作树中。 使用' - '分隔修订版本的路径,如下所示: 'git [ ...]'[ ...]' – IdeoREX

4

你已经错过了断 '--add' 和Git不喜欢(至少在我的MAC)format: '%h之间的空间

尝试:

$ git config --global --add alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" 
+0

这个人也为我工作win10以及...谢谢你们。 –