I often find myself typing
git add -u
with the intention of adding everything that is modified but tracked in the whole repository. However, it gets annoying and tedious when I'm in a subdirectory. For example if all my modifications are in src/
but I'm currently in the test/util
directory, then I need to type
git add -u ../..
which is error-prone and slow (because I need to compute the number of ../
in my head).
I would like to create a git alias au
such that it automatically detects the toplevel (usually, the first ancestor directory in the path that contains the .git
directory). It doesn't have to be perfectly portable, since I use git from bash
. Any ideas?