Show just the commits done to a git branch, when this branch has been already merged into master/develop
git log mybranch --not $(git for-each-ref --format='%(refname)' refs/heads/ | grep -v "refs/heads/mybranch")
Vim automatically adds a newline character at the end of a file, and this causes git diff showing it. We can get rid of this character by doing this
perl -pi -e 'chomp if eof' filename