Skip to content

Instantly share code, notes, and snippets.

View Engelch's full-sized avatar

Christian ENGEL Engelch

  • Switzerland
View GitHub Profile
@Engelch
Engelch / inGitRepo.sh
Created June 18, 2022 09:29
bash check if in git repo and if so jump to root of git repo
_gitRootDir=$(git rev-parse --show-toplevel 2>/dev/null); res=$?
[ $res -eq 0 ] && debug git found, jumping to git root && cd "$_gitRootDir"