“砰”的意思是什么?或“!”在git命令之前? [英] What is the meaning of the "bang" or "!" before the git command?

查看:155
本文介绍了“砰”的意思是什么?或“!”在git命令之前?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你从这段摘录中看到的那样,有一个!在git命令之前。有什么意义?

  [别名] 
commitx =!git add。 &安培;&安培; git commit

- https://stackoverflow.com/a/8956546/1354543



我了解别名和命令本身在做什么,但不是!之前的git命令。

解决方案

表示运行以下作为shell的命令,所以在这种情况下,别名 git commitx 扩展为相当于运行 git add。 &安培;&安培; git commit (这是一个糟糕的主意)


As you can see from this excerpt, there is a "!" before the git command. What's the point?

[alias]
commitx = !git add . && git commit

- https://stackoverflow.com/a/8956546/1354543

I understand aliases and what the command itself is doing, but not the point of the "!" before the git command.

解决方案

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)

这篇关于“砰”的意思是什么?或“!”在git命令之前?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆