-3

Currently I am doing this to amend my changes to the most current commit:
$ git add .
$ git commit --amend

Is there a way to stage and amend in one command?

Minjun Yu
  • 3,497
  • 4
  • 24
  • 39
  • mind explain why the downvote? this was a legit question that bothered me. I tried to do my research before this but could not find out the answer. – Minjun Yu Jan 10 '18 at 18:27

1 Answers1

1

Woops, Just found out this would work. Didn't know -a and --amend could be used together. I am putting answer to my own question in case someone wondering the same.
git commit -a --amend

Minjun Yu
  • 3,497
  • 4
  • 24
  • 39
  • Note that there's a bit of difference between this and `git add .; git commit --amend`. It's the same, on success, as `git add -u; git commit --amend`. (This is often what you want anyway—just be aware that it won't add *new* files.) – torek Jan 11 '18 at 00:49