From 000e00871830cd15de032c80e2b62946cf19445c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 8 May 2025 18:49:34 -0500 Subject: adding missing dotfiles and folders - profile.d/ - bashrc - authinfo.gpg - .zsh/ --- dotfiles/system/.profile.d/git.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 dotfiles/system/.profile.d/git.sh (limited to 'dotfiles/system/.profile.d/git.sh') 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 +# 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" +} -- cgit v1.2.3