What is the meaning of the “bang” or “!” before the git command?

孤者浪人 提交于 2019-12-04 23:39:20

The ! means "run the following as commands to the shell", so in this case the alias git commitx expands to the equivalent of running git add . && git commit (which is a terrible terrible idea)

An important aspect of ! not covered by the accepted answer is that for the shell command, the working directory is set to the top level of the working copy. Therefore, git commitx would stage then commit all new and changed files in the working copy, while running git add . && git commit manually would stage then commit all new and changed files in the current directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!