Add configuration for git
- Add .config/git/config + Define aliases + Configure default behavior in various situations + Add user information with signing key - Add .config/git/commit_msg_template.txt - Add .config/git/ignore - Integrate `git` aliases into the shell
This commit is contained in:
parent
3017a7bdec
commit
721c2fd905
21 changed files with 1122 additions and 66 deletions
32
.local/bin/git-ff-all
Executable file
32
.local/bin/git-ff-all
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Fast-forward all local branches that track a remote branch
|
||||
#
|
||||
# Branches with local-only commits are skipped
|
||||
#
|
||||
# Usage: git ff-all
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
git fetch --all --prune
|
||||
|
||||
|
||||
current="$(git branch --show-current)"
|
||||
|
||||
|
||||
git for-each-ref --format='%(refname:short) %(upstream:short)' refs/heads/ |
|
||||
while read -r branch upstream; do
|
||||
|
||||
[ -n "$upstream" ] || continue
|
||||
|
||||
if [ "$branch" = "$current" ]; then
|
||||
git merge --ff-only "$upstream" 2>/dev/null \
|
||||
|| echo "Skipped $branch (not a fast forward)"
|
||||
continue
|
||||
fi
|
||||
|
||||
git fetch . "$upstream:$branch" 2>/dev/null \
|
||||
|| echo "Skipped $branch (not a fast forward)"
|
||||
|
||||
done
|
||||
Loading…
Reference in a new issue