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
21
.local/bin/git-point-branch-at
Executable file
21
.local/bin/git-point-branch-at
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Move a branch to a commit, whether or not it is checked out
|
||||
#
|
||||
# Usage: git point-branch-at [<branch>] <commit>
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
case $# in
|
||||
1) _branch=$(git rev-parse --abbrev-ref HEAD); _commit=$1 ;;
|
||||
2) _branch=$1; _commit=$2 ;;
|
||||
*) echo "Usage: git point-branch-at [<branch>] <commit>" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "$_branch" = "$(git rev-parse --abbrev-ref HEAD)" ]; then
|
||||
exec git reset --keep "$_commit"
|
||||
else
|
||||
exec git branch --force "$_branch" "$_commit"
|
||||
fi
|
||||
Loading…
Reference in a new issue