Last active
August 10, 2016 15:05
-
-
Save rednebmas/05f8820229bd775400d8f446ed4836c9 to your computer and use it in GitHub Desktop.
Useful and common bash commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######### | |
| ## Git ## | |
| ######### | |
| # search diff of dangling commits for the word AVCaptureDevice | |
| git fsck --no-reflog | awk '/dangling commit/ {print $3}' | \ | |
| while read ref; do if [ "`git show -p $ref|grep -c AVCaptureDevice`" -ne 0 ]; then echo $ref ; fi ; done | |
| # list git commit messages for dangling commits | |
| git fsck --lost-found | grep "dangling commit" | cut -d" " -f 3 | xargs -I "{}" git show --stat "{}" # view git messages for dangling commits | |
| # recursive find and replace without corrupting git index | |
| grep -r -l --exclude-dir=.git 'OUPAlbumSelectNavItemViewController' . | sort | uniq | xargs perl -e "s/OUPAlbumSelectNavItemViewController/OUPPhotoAlbumSelectNavItemViewController/" -pi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment