git grep "text to look for" $(git rev-list --all)
git log --pretty=format:%s HASH..HEAD
git config branch.master.mergeoptions "--no-ff"
Hint: Don't do this on your local working copy, or everytime you do a 'pull' from origin it will create yet another explicit commit (as opposed to a simple fast-forward).
git branch -f <BRANCH_TO_MOVE> master
(From http://stackoverflow.com/a/24045966)
You can significantly speed up git on Windows by running three commands to set some config options:
git config --global feature.manyFiles true
git config --global core.preloadindex true
git config --global core.fscache true
git config --global gc.auto 256
Notes:
-
core.preloadindex
does filesystem operations in parallel to hide latency and will be enabled by default in future versions of git on all platforms (update: enabled in v2.1) -
core.fscache
fixes UAC issues (don't need to run git as admin) -
gc.auto
minimizes the number of files in .git
git diff --name-status SHA1 SHA2
Saves results to text file bigtosmall.txt
(From http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history)
git rev-list --objects --all | sort -k 2 > allfileshas.txt
git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r > bigobjects.txt
for SHA in `cut -f 1 -d\ < bigobjects.txt`; do
echo $(grep $SHA bigobjects.txt) $(grep $SHA allfileshas.txt) | awk '{print $1,$3,$7}' >> bigtosmall.txt
done;