Skip to content

Instantly share code, notes, and snippets.

@jorgeas80
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgeas80/c796ad62afa5f20312f2 to your computer and use it in GitHub Desktop.
Save jorgeas80/c796ad62afa5f20312f2 to your computer and use it in GitHub Desktop.
Nice command line tricks

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment