An alias that will generate a git commit message staged changes as shown in git-status. Put this alias (section below) in your .gitconfig
.
The message generated will be in the format of:
$ git status --porcelain
A file1.py
A file2.py
A file3.py
M file4.py
M file5.py
D README.md
R test.txt-> test2.txt
$ git commit-status
$ git log --no-decorate -n 1
bee4f8e Added: file1.py file2.py file3.py Modified: file4.py file5.py Deleted: README.md Renamed: test.txt-> test2.txt
Shared on Stack Overflow.
@isayakmondal Hello!
Yes I was just about to write that, that a space before means that the
M
is is for the file in the working area, not in the staged area (aftergit add
).Nevertheless, I started to look at this alias and felt a need to simplify it a bit. I worked out an updated version. As you are an active user of this one, would you mind trying if it works for you as well? It works when I've tested it, but it would be great to hear if it works also for at least another person!