开发者

Why can't I get this Git alias to work?

开发者 https://www.devze.com 2023-04-06 14:53 出处:网络
I\'ve installed git for windows. I want com to be an alias for commit -m, so that I can write for example

I've installed git for windows. I want com to be an alias for commit -m, so that I can write for example

git com "dumb commit message"

and it works the same way as if I'd written

git commit -m "dumb commit message"

I added this line to the "gitconfig" file (why do these linux types have such a hatred of file extensions?):

[alias]
    com = 'commit -m'

This doesn't work. I get

error: pathspec 'dumb commit message' did no开发者_StackOverflowt match any file(s) known to git.

I tried variations on the above syntax in "gitconfig" and I tried to define it from within Git Bash. I can't seem to get it right.


Do not use quotes around the value, just the plain command:

[alias]
   com = commit -m
0

精彩评论

暂无评论...
验证码 换一张
取 消