2

I'm really lazy, so I often like to run git commit -am 'msg' to add and commit everything in one swoop. If I'm lucky, I haven't added any untracked files and this will work fine. However, sometimes I'll do this, run git status much later in the midst of some other work, realize I messed up, and then have to do acrobatics with git stash and git reset to put the untracked files in the proper commit. This is really time-consuming.

I'm wondering if there's a way to both stage changes and add untracked files and commit with a single git command. Something that would be the equivalent of

git add -A :/
git commit -m 'msg'

Is there such a command?

James Ko
  • 32,215
  • 30
  • 128
  • 239

1 Answers1

0

You can add commit the one file or multiple files:

git add /file1 /folder/file2 ...
git commit -m "message"

// single file
git add /file3
git commit -m "message"
BenRoob
  • 1,662
  • 5
  • 22
  • 24
drdhnrq
  • 39
  • 1