How to navigate to the git root directory (#snippet)

Today Bez Hermoso’s git tip passed my Twitter timeline, and it’s worth bookmarking it here on my blog.
Whenever you find yourself cd’ing around in a large project just to reach the root of a git repository, the following alias might…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Today Bez Hermoso's git tip passed my Twitter timeline, and it's worth bookmarking it here on my blog.

Whenever you find yourself cd'ing around in a large project just to reach the root of a git repository, the following alias might come in handy.

alias gr='cd $(git rev-parse --show-toplevel)'

It automatically navigates you to the git repo root! 💪


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2022-05-19T22:00:00+00:00) How to navigate to the git root directory (#snippet). Retrieved from https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/

MLA
" » How to navigate to the git root directory (#snippet)." Stefan Judis | Sciencx - Thursday May 19, 2022, https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/
HARVARD
Stefan Judis | Sciencx Thursday May 19, 2022 » How to navigate to the git root directory (#snippet)., viewed ,<https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/>
VANCOUVER
Stefan Judis | Sciencx - » How to navigate to the git root directory (#snippet). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/
CHICAGO
" » How to navigate to the git root directory (#snippet)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/
IEEE
" » How to navigate to the git root directory (#snippet)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/. [Accessed: ]
rf:citation
» How to navigate to the git root directory (#snippet) | Stefan Judis | Sciencx | https://www.scien.cx/2022/05/19/how-to-navigate-to-the-git-root-directory-snippet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.