git-root

I wrote a little bash alias a while ago to help me instantly to the root directory of a git project from any directory beneath it. https://gist.github.com/nicholascloud/34cca23cafc620045d57 It’s pretty simple. Assume /projects/foo is the root of a project under git. Assume your pwd is /projects/foo/bar/baz. At the prompt, typing git-root will return you to /projects/foo. This works by changing pwd to be the actual .git directory under the project root, and then backing out of it one level up (to ..).