Powerful git Commands

Pickaxe (with & without specified file)

Search diffs for a particular string.

Purpose: If you’re trying to figure out when a particular line was changed and by who.

Across all diffs

git log -S your-string 

In a Specific File

git log -S your-string --path/to/your/file

Source

More Documentation on git log

–merged

Purpose: When you’re trying to identify branches that can be deleted.

git branch --merged master

(Change “master” to branch of your choice.)

Source

check-ignore

Purpose: When files are being ignored but you are having difficulties determining which line in .gitignore is causing it.

git check-ignore –n –v path/to/your/ignored/file

My post

Documentation

Updating a Commit Message – rebase & reword

git rebase -i HEAD~1

(Change “1” to the number of previous commits you want to review.)

Follow the on-screen prompts to reword.

Source