[Bf-committers] Git issues and workarounds

Jonas Wielicki j.wielicki at sotecware.net
Thu Nov 28 10:03:52 CET 2013


On 27.11.2013 09:32, Sergey Sharybin wrote:
> Accidents with staging wrong files might always happen, even if you always
> staging files manually with `git add path/to/file`.
> 
> The things is, while i agree `git commit -a` is not the best thing to do,
> `git commit .` is not better in any respect. If you really want to prevent
> accidents from happening, stage files individually with `git add`.

I suggest you look into git commit -pv. The -p option will let you walk
through all your changes and select, view and modify them on a per-hunk
basis for staging. This leaves your working directory unaltered, but
allows you to stage small changes individually. So it is even more
fine-grained than git add.

> This is the main purpose for now and please stop threads like "in an ideal
> world you should not use A and you should use B instead". World is not
> ideal and such a suggestions will confuse people even more, giving us more
> unwanted accidents.

Hopefully this was not too disrupting :/

just my 2 cents,
Jonas


More information about the Bf-committers mailing list