Skip to content

Instantly share code, notes, and snippets.

@pixmin
Created October 25, 2018 12:58
Show Gist options
  • Select an option

  • Save pixmin/6c005ac1ebf7f649f3ce95cc44c0a98b to your computer and use it in GitHub Desktop.

Select an option

Save pixmin/6c005ac1ebf7f649f3ce95cc44c0a98b to your computer and use it in GitHub Desktop.
GIT Find orphan commits
$ git log origin/preprod --no-color | grep '^commit' | sed 's#^commit ##' | while read r; do if [ "$(git branch --contains "$r" | wc -l)" == "1" ]; then echo $r; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment