eonil
eonil

Reputation: 86015

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

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?

Upvotes: 0

Views: 182

Answers (2)

yasouser
yasouser

Reputation: 5177

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

Upvotes: 1

Edward Z. Yang
Edward Z. Yang

Reputation: 26742

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

Upvotes: 1

Related Questions