What does the exclamation mark mean in git config alias?

后端 未结 2 1843
情深已故
情深已故 2020-12-29 19:43

I just see a git config command as below:

git config --global alias.out \\!\"git fetch; git cherry origin/HEAD -v\"

what does it mean? Is i

相关标签:
2条回答
  • 2020-12-29 20:27

    From the git-config manual:

    If the alias expansion is prefixed with an exclamation point, it will be treated as a shell command.

    0 讨论(0)
  • 2020-12-29 20:28

    From https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

    However, maybe you want to run an external command, rather than a Git subcommand. In that case, you start the command with a ! character

    So if you only want to use git subcommand, you don't need to use ! here.

    But if you want to use git command/external command, then you need !.

    0 讨论(0)
提交回复
热议问题