For when I have to wrangle lots of files at once (like during interactive rebase to clean up history before push) I have a git watch alias that shows a high-level overview of changes that refreshes with inotify:
[alias]
watch = "!clear;inotifywait --quiet -mr -e modify,move,create,delete --format \"%f %e\" @/.git . | \
while read file; do \
clear;\
git status --short;\
git --no-pager diff --shortstat;\
done;"
I leave that running in a visible terminal window. It's more verbose than a prompt and reduces the need for constant git status sanity-checking. Maybe useful for someone.
I like my git prompt to show me my branch name, colored with grey (no changes), red (unsaved changes), or green (staged changes), with the depth of the branch, e.g.:
# I sometimes have very long branch names.
# I don't assume it's a hash:
if [ ${#GIT_BRANCH} -gt 40 ]; then
# GIT_BRANCH="(no branch)"
GIT_BRANCH="${GIT_BRANCH:0:40}..."
fi
and, at the end of `git_prompt`:
branch_depth=`git rev-list HEAD --not --remotes|wc -l`
echo "[$git_color$GIT_BRANCH$c_reset:${branch_depth}]"
I deliberately set the .git directory to be ignored (using @) to avoid tons of repeating when the index.lock file is repeatedly recreated. Maybe that's what's going on here.
For when I have to wrangle lots of files at once (like during interactive rebase to clean up history before push) I have a git watch alias that shows a high-level overview of changes that refreshes with inotify:
I leave that running in a visible terminal window. It's more verbose than a prompt and reduces the need for constant git status sanity-checking. Maybe useful for someone.