#!/bin/sh
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Shows a console based graphical version of the branches and their joins.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
git log --graph --format="%Cgreen%ci%Creset %h %Cblue%ae %Cred"
List all branches
#!/bin/sh
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Displays all branches of a git repository ordered by the most recently updated one.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for branch in `git branch -r | grep -v HEAD`;do echo `git show --format="%Cgreen%ci%Creset %h %Cblue%ae %Cred" $branch | head -n 1` \\t$branch; done | sort -r
List altered files
#!/bin/sh
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Lists all files ever changed within the history.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# drop summary lines here drop commit lines drop graph remove first char
git log --stat=4096 --oneline | grep -v "file changed" | grep -v "files changed" | grep -v "^[0-9a-fA-F]" | sed 's/|.*//' | sed 's/^.//'
Retrieve the commit count since the last tag
#!/bin/sh
# identify the lasttag first
export LASTTAG=$(git rev-list --tags --no-walk --max-count=1)
export COMMITCOUNT=0
# get the number of commits since the last tag if available
if [ "" != "${LASTTAG}" ]; then
export COMMITCOUNT=$(git rev-list ${LASTTAG}.. --count)
fi
echo "${COMMITCOUNT}"