A random collection of git
commands that were helpful to me, and might be helpful to you.
git log --grep="search query"
List local branches that have been merged into master
git branch --merged master
List remote branches that have been merged into master
git branch -r --merged master
Delete local branch
git branch -D <branchname>
Delete remote branch
git push origin :<branchname>
Show git branches by date
for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
Add as command by adding creating bash script (without .sh) in
/usr/local/bin/git-branch-dates
#!/bin/bash
for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
Git automatically searches through any bash scripts on your path that start with git- so you can now run:
git branch-dates