My usual git workflow is
<make changes>
git add FILES
git status
git commit -m "some remarks"
where I need the git status
just to check if I added the correct files.
Is there a way to tell git
to automatically display the status after each git add
?
You can use an alias:
Since
git
aliases work from the repository root1, you could modify the alias to make it work from any other directory:Now invoke it by saying
1: Note that shell commands will be executed from the top-level directory of a repository, which may not necessarily be the current directory.
You can do it via creating an alias that executes
add first and then status
usinggit config
commnad ..When run with
-v
(verbose) option,git add
outputs the name of files that were added:Here's what I have using the answer at https://stackoverflow.com/a/26243454 and combining it with devnull's answer:
This way you don't need to pass in the working directory manually.