git add -p
allows you to traverse through each modified file one at a time.
I would like a similar version; however, it needs to allow you to stage one file at a time. I want to be able to stage and provide the commit message as well.
git add -p
allows you to traverse through each modified file one at a time.
I would like a similar version; however, it needs to allow you to stage one file at a time. I want to be able to stage and provide the commit message as well.
I think you need the switch -o for example:
git commit -o file1
So you want to do this?
git add <file1>
git commit [-m "message"]
git add <file2>
git commit [-m "message"]
...
Here's a quickie I use to bang through all the modified items from git status. We do a commit one at a time so I can add comments for each one.
for each_git_file in
`git status | egrep 'modified|new file' | awk -F: '{print $2}' | sed 's/[\W\.]*//'`;
do
git commit -o $each_git_file;
done