Skip to content

Instantly share code, notes, and snippets.

@abelcallejo
Last active January 3, 2020 08:51
Show Gist options
  • Save abelcallejo/5ea942d4bc07772fb8c7f57747e68b0a to your computer and use it in GitHub Desktop.
Save abelcallejo/5ea942d4bc07772fb8c7f57747e68b0a to your computer and use it in GitHub Desktop.
Minimalistic git commands

git

Minimalistic git commands

git status

Lists all the modified files only. The number of lines of the output determines the number of files/folders modified.

git status --short --untracked-files=no

Shows the number of modified files

MODIFIED=$(git status --short --untracked-files=no | wc -l | xargs)
echo $MODIFIED

git log

Number of commits between two commits

count=$(($(git rev-list --count aaaa00..bbbb11)))
echo $count

Number of commits between two commits of a specific user

count=$(($(git rev-list --count aaaa00..bbbb11 --author=abelcallejo)))
echo $count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment