Files
skel/dotfiles/zshrc.d/cdgr.zsh
David Tomaschik 9ab1f9c298 Misc updates
2026-02-18 16:10:06 -08:00

10 lines
218 B
Bash

# Change to the root of the git repository.
# If not in a git repo, do nothing.
cdgr() {
local git_root
git_root=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -n "$git_root" ]; then
cd "$git_root"
fi
}