Skip to content

Commit

Permalink
New git aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Encephala committed Jun 27, 2024
1 parent 1252d4d commit 08d9752
Showing 1 changed file with 4 additions and 34 deletions.
38 changes: 4 additions & 34 deletions roles/provision/templates/zsh/dotzprofile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Git aliases
# git log
alias gl="git log --oneline -n10"
# git status
alias gs="git status"
# git diff
alias gd="git diff"
alias gdc="git diff --cached"
alias gp="git push"
alias gr="git restore"
alias gane="git commit --amend --no-edit"

# CD git root
cdgr() {
Expand All @@ -22,37 +23,6 @@ zgr() {
}
{% endif %}

# git amend last commit
# dunno if I want to keep this
galc() {
if [ -z $(git status --porcelain) ]
then
echo "No changes to be committed"
return 0
fi

echo "STATUS:"
git status
echo

echo "LATEST COMMITS:"
git log --oneline -n 5
echo

read -q "CONFIRM?CONFIRM? [yN] "
echo
echo

if [[ $CONFIRM == "y" ]]
then
echo "COMMITTING:"
git add .
git commit --amend --no-edit
else
echo "ABORTING"
fi
}


# Cargo aliases
# cargo test workspace
Expand Down

0 comments on commit 08d9752

Please sign in to comment.