mirror of
https://github.com/theniceboy/.config.git
synced 2025-12-26 14:44:57 +08:00
10 lines
250 B
Bash
10 lines
250 B
Bash
function gr() {
|
|
local git_root
|
|
git_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
if [[ $? -eq 0 && -d $git_root ]]; then
|
|
cd "$git_root"
|
|
else
|
|
echo "Not in a git repository or could not find the git root."
|
|
fi
|
|
}
|
|
|