Git : Add gcd.

This commit is contained in:
Dmitry Voronin 2024-10-11 21:51:19 +03:00
parent 1eb2a9ff79
commit 532a23788c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -39,6 +39,13 @@
git stash "''${@}"
}
# Cd to git's root dir.
function gcd() {
local path=$(git rev-parse --show-toplevel)
[[ "''${path}" = "" ]] && return 1
cd "''${path}"
}
# Git diff.
function gd() {
git diff "''${@}"