Skip to content

Commit

Permalink
git do git alias
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 15, 2023
1 parent 38346a4 commit 1484ead
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .config/fish/conf.d/plugin-foreign-env.fish
2 changes: 1 addition & 1 deletion .config/fish/config.fish
9 changes: 8 additions & 1 deletion .config/git/config
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@
[alias]
fixup = commit --all --amend
empty = commit --allow-empty -m 'Add an empty commit'
current-branch = symbolic-ref --short HEAD
current = symbolic-ref --short HEAD
# default = !git symbolic-ref refs/remotes/origin/HEAD | cut -f4 -d'/' # made error in dirty?
switch-default = !git checkout main 2>/dev/null || git checkout master 2>/dev/null
upstream = !git remote | grep -E '^upstream$'|| git remote | grep -E '^origin$'
duster = remote update origin --prune
refresh = !git switch-default && git pull "$(git upstream)" "$(git current)"
# Depending gh poi :)
all = !git refresh && gh poi
6 changes: 0 additions & 6 deletions home/.aliases.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env bash

alias git-switch-default='git checkout main 2>/dev/null || git checkout master 2>/dev/null'
alias git-upstream="git remote | grep -E '^upstream$'|| git remote | grep -E '^origin$'"
# https://github.com/kyanny/git-delete-merged-branches/pull/6
alias git-delete-merged-branches="git branch --merged | grep -vE '((^\*)|^ *(main|master)$)' | xargs -I % git branch -d %"
alias git-cleanup-branches='git-switch-default && git pull $(git-upstream) $(git current-branch) && git fetch $(git-upstream) --tags --prune && git-delete-merged-branches'

alias la='exa --long --all --group-directories-first'

alias zj='zellij attach "$(basename "$PWD")" || zellij --session "$(basename "$PWD")"'
Expand Down

0 comments on commit 1484ead

Please sign in to comment.