Created
May 2, 2026 17:38
-
-
Save unrevised6419/6b0a6188391533319cae4d479a0e6a33 to your computer and use it in GitHub Desktop.
change directory (cd) into a repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cd into the root of the worktree | |
| cdw() { | |
| cd "$(git rev-parse --show-toplevel)" | |
| } | |
| # cd into the root of the default worktree | |
| cdr() { | |
| cd "$(git rev-parse --git-common-dir | xargs dirname)" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment