Every Git page below this section is a candidate for current updating – many of those pages are still just fine, but are subject to improvement in the near future.
git ls-files
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 reposgit config --global alias.unadd “reset HEAD”
git rev-list HEAD | tail -1
to get root commitcheckout.defaultRemote
git fsck
to track down staged, then reset files (git show
)git checkout -p
git rm -rf :/ && git checkout commit-ish – :/
git log -M
git push origin +branchname
git checkout -b maint origin/maint
git diff –name-only <commit>^!
git cat-file -p HEAD
git ls-tree -r HEAD
git ls-files -s