开发者

Is there a `git` command commits all of add/modify/remove at once?

开发者 https://www.devze.com 2023-02-15 08:53 出处:网络
As I know, I have to use git add . git commit -m \"Test.\" to add files. And for update and delete, git commit -a -m \"Test.\"

As I know, I have to use

git add . 
git commit -m "Test."

to add files.

And for update and delete,

git commit -a -m "Test."

However second command does not handle file addition. Is there开发者_运维问答 a command which does all of these at once?


No. Though, if you can guarantee that all un-ignored, un-versioned files want to be versioned, git add . is a doozy.


If you want to add and commit, you can create a shell script that does that.

git add .; git commit -a

This will open up the editor specified in your .gitconfig and you can enter the commit message.

You can even parameterize the path you want to add:

git add $1; git commit -a

0

精彩评论

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

关注公众号