diff options
| author | Craig Jennings <c@cjennings.net> | 2025-05-21 22:01:35 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-05-21 22:01:35 -0500 |
| commit | b4463015b97912658d630377fafbf630f7588d1e (patch) | |
| tree | d04b66d992fe2ce88391889c21c5d8dc97acd0ef /dotfiles/system/.profile.d/git.sh | |
| parent | 548154ea395356868e87980b149dfc0abdc84e17 (diff) | |
moving arch dotfiles into archsetup
Diffstat (limited to 'dotfiles/system/.profile.d/git.sh')
| -rw-r--r-- | dotfiles/system/.profile.d/git.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dotfiles/system/.profile.d/git.sh b/dotfiles/system/.profile.d/git.sh new file mode 100644 index 0000000..7332ba1 --- /dev/null +++ b/dotfiles/system/.profile.d/git.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# git.sh +# Craig Jennings <c@cjennings.net> +# git settings and convenience aliases, sourced by .profile + +alias gitlog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" +alias gitstatus='git status -sb ' +alias gitcom='git commit -m ' +alias gitpp='git pull --prune ' # clean up any orphaned git objects +alias gittagbydate="git for-each-ref --sort=creatordate --format '%(refname) %(creatordate)' refs/tags" + +gitsp() { + git stash && git pull && git stash pop +} + +gitck() { + git checkout "$(git branch --all | fzf| tr -d '[:space:]')" +} + +gitdiff() { + preview="git diff $@ --color=always -- {-1}" + git diff "$@" --name-only | fzf -m --ansi --preview "$preview" +} |
