Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Last active July 31, 2016 08:59
Show Gist options
  • Select an option

  • Save ScalaWilliam/0ae7d9637e6b69d94acd8bcd9e40e821 to your computer and use it in GitHub Desktop.

Select an option

Save ScalaWilliam/0ae7d9637e6b69d94acd8bcd9e40e821 to your computer and use it in GitHub Desktop.
Finding an ID for the current repository:
```
$ git remote -v | sed -E -n -e 's/^.*https:\/\/(github|bitbucket)[^/]+\/([^/]+)\/([^/]+)\.git \(fetch\)/\1\/\2\/\3/p' -e 's/^.*git@(github|bitbucket)[^:]+:([^/]+)\/(.*)\.git \(fetch\)/\1\/\2\/\3/p' | head -n 1
github/ScalaWilliam/git.watch
```
sed -u -n -e '
/^event: push$/ {
n
/^id: refs\/heads\/master/ {
n
s/^data: \([0-9a-f][0-9a-f]*\)$/\1/p
}
}
'
#cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment