是否有可能跳过暂存区域并(也)将未跟踪的新文件提交给git? [英] Is it possible to skip the staging area and (also) commit untracked, new files to git?

查看:229
本文介绍了是否有可能跳过暂存区域并(也)将未跟踪的新文件提交给git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能跳过暂存区域和(也)提交未跟踪的新文件以在单个内置命令行命令中混用?如果不是,有什么选择?

http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository


为git commit命令提供-a选项可以让Git
自动为每个已经被跟踪的文件分配
commit,让您跳过git add部分:



$ git commit -a -m'添加了新基准'




谢谢。

解决方案

这对于大师来说可能看起来相当微不足道, (我承认) - 至少我现在第一次使用它,它可以工作(没有自定义别名):只需使用分号; code>,它可以作为一个单行程序:

git add --all; git commit -m一些提示信息


Is it possible to skip the staging area and (also) commit untracked, new files to git in a single built-in, command-line command ? If not, what are the alternatives ?

http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository

Providing the -a option to the git commit command makes Git automatically stage every file that is already tracked before doing the commit, letting you skip the git add part:

$ git commit -a -m 'added new benchmarks'

Thanks.

解决方案

This might seem quite trivial for the gurus, but is a minor revelation to me (I admit) - at least I just used it for the first time now and it works (without custom aliases): Just use a semicolon ; and it'll work as a one-liner:

git add --all; git commit -m "some informative commit message"

这篇关于是否有可能跳过暂存区域并(也)将未跟踪的新文件提交给git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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