Move to the Root of a Git Directory Source: My friend Alex Novak cd `git rev-parse --show-toplevel` I keep this aliased as groot and use it very frequently when moving through a codebase.