Skip to content

Instantly share code, notes, and snippets.

@jhradilek
Created December 21, 2012 03:54
Show Gist options
  • Save jhradilek/4350573 to your computer and use it in GitHub Desktop.
Save jhradilek/4350573 to your computer and use it in GitHub Desktop.
A Git alias to list all files ever tracked in a certain branch
# Usage: git ls-all [OPTION...] [SINCE..UNTIL]
#
# Options:
#
# In theory, the command accepts all command line options supported by
# the "git log" command. In reality, however, only commit-limiting
# options are useful. This includes:
#
# --author=PATTERN, --committer=PATTERN
# Lists only files that were changed by a certain author.
#
# --since=DATE, --after=DATE
# Lists only files that were changed after a specific date.
#
# --until=DATE, --before=DATE
# Lists only files that were changed before a specific date.
#
# Examples:
#
# git ls-all
# Lists all files that were ever tracked in the current branch.
#
# git ls-all [email protected]
# Lists all files that were changed by [email protected].
#
# git ls-all a185d6b..bdef2c8
# Lists all files that were changed between commits a185d6b and
# bdef2c8.
[alias]
ls-all = "!f() { git log --pretty=format: --name-only \"$@\" -- | sort -u | sed -e '/^$/d'; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment