Thank you.
Here is what I meant:
echo alpha > a.txt
add a.txt
echo beta > b.txt
add b.txt
echo gamma >> b.txt

Now I have a.txt and b.txt in staged state; and b.txt also has unstaged 
I want to commit ONLY b.txt (i.e. I want to commit only 'beta' and leave 
b.txt in modified state with 'beta' & 'gamma' in it, 'gamma' being showed 
as '+gamma' in `git diff'.
Something like `git commit --staged b.txt'
In other words, how do we `git commit' just one file from the index if 
there are more than one files in the index.


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to