Git Command Options

git-dir

DON'T FORGET THE .git AT THE END OF THE DIR PATH!!

git --git-dir=path/to/git/dir/.git <git-command (e.g. log, commit, push, etc.)>

branch

If the branch is remote (you did not fetch), then you have to append the branch name to origin/

git <git-command (e.g. log, commit, push, etc.)> origin/<BRANCH_NAME>

date

Date options:

  • iso-strict-local

  • relative

  • local

  • iso

  • short

  • human

git <git-command> --date=<date_option>

pretty

Format options:

  • %ad (show date)

  • %ae (show author)

git <git-command> --pretty=format:'<format_option>'

Last updated