Last active
July 31, 2016 08:59
-
-
Save ScalaWilliam/0ae7d9637e6b69d94acd8bcd9e40e821 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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