Share project git fetch b/w ZSH and SESH

This commit is contained in:
Yax 2026-01-22 08:11:17 +01:00
parent 7abac0e4e9
commit 46a372a873
2 changed files with 10 additions and 13 deletions

View file

@ -66,21 +66,9 @@ if command -v tig &>/dev/null; then
fi fi
chpwd() { chpwd() {
# Is this directory inside a git repo? project_git_fetch
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
# Are we at the repo root? (prefix empty = root)
if [ -z "$(git rev-parse --show-prefix)" ]; then
echo "Fetching latest changes from remote..."
git fetch
fi
fi
} }
alias f='git fetch'
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Editor # Editor
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# Is this directory inside a git repo?
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
# Are we at the repo root? (prefix empty = root)
if [ -z "$(git rev-parse --show-prefix)" ]; then
echo "Fetching latest changes from remote..."
git fetch
fi
fi