User Tools

Site Tools


Current wiki pages

New (yes, new) Git pages as of February, 2019

Multi-level pages

Working on

Specific topic pages


  • git prune (use git gc, which calls git prune)
  • git whatchanged (use git log)
  • git annotate (use git blame)

Additional reference info

Stuff to ponder, resolve and add somewhere

  • WRT next commit, what is in the index is all that matters.
  • git ls-files
  • More people should read man gitcli. Seriously.
  • git log --remove-empty – stop when a given path disappears.
  • git reset will not delete files it does not track, including files it is told to ignore.
  • git push will not affect the remote working tree; try to avoid pushing to non-bare repos
  • git config --global alias.unadd “reset HEAD”
  • git rev-list HEAD | tail -1 to get root commit
  • Config variable checkout.defaultRemote
  • use git fsck to track down staged, then reset files (git show)
  • reset a file with git checkout -p
  • git rm -rf :/ && git checkout commit-ish – :/
  • Danger with reverting a merge commit.
  • Renaming:
    • git log -M
  • git push origin +branchname
  • git checkout -b maint origin/maint
  • What files changed in a given commit? git diff –name-only <commit>^!

Other stuff to add (not sure where)

  • comprehensive guide to dealing with whitespace issues
  • branch names and wildcarding
  • git cat-file -p HEAD
  • git ls-tree -r HEAD
  • git ls-files -s
  • smudge and clean filters

New/adequate as of May 20, 2018 or later

Advanced Git

Need updating

git.txt · Last modified: 2019/10/01 19:03 by rpjday