60 lines
2.6 KiB
HTML
60 lines
2.6 KiB
HTML
---
|
|
layout: post
|
|
title: Some small github integration scripts
|
|
redirect_from:
|
|
- /01476216996
|
|
---
|
|
<body>
|
|
<b>Update, 2018-04-01</b>: I added <a href="https://media.unpythonic.net/emergent-files/01476216996/git-remote-add-github">git-remote-add-github</a>, a tool for adding github forks as remotes.
|
|
|
|
<p>This is a little script I cooked up a few months ago, then hacked on a
|
|
little bit this week. It provides a convenient shortcut to locally
|
|
fetch or merge the changes in a github pull request. It doesn't require
|
|
any special privileges (e.g., github account, API key) to use, unlike
|
|
other alternatives like github-cli (ghi).
|
|
|
|
<p><p><b>Files currently attached to this page:</b>
|
|
<table cellpadding=5 style="width:auto!important; clear:none!important"><col><col style="text-align: right"><tr bgcolor=#eeeeee><td><a href="https://media.unpythonic.net/emergent-files/01476216996/git-merge-pr">git-merge-pr</a></td><td>2.9kB</td></tr><tr bgcolor=#dddddd><td><a href="https://media.unpythonic.net/emergent-files/01476216996/git-remote-add-github">git-remote-add-github</a></td><td>1.8kB</td></tr></table><p>
|
|
|
|
<p><pre>
|
|
# Quick commandline tool for fetching and/or merging github pull requests.
|
|
#
|
|
# Steps for use:
|
|
#
|
|
# Once per computer or user, depending on location:
|
|
# Install the program `jq`; debian package name `jq`
|
|
#
|
|
# Place this in the system directory shown by `git --exec-path` or in any
|
|
# directory listed on your $PATH, typically including $HOME/bin
|
|
#
|
|
# You can (re)name it what you like, except that the name must begin
|
|
# "git-". If the script name includes "pull" or "merge", invoking it will
|
|
# do a merge. Otherwise, it will do a "fetch", leaving the branch for you
|
|
# to inspect at FETCH_HEAD
|
|
#
|
|
# (you can create the second copy with e.g. `ln -s`)
|
|
#
|
|
# Once for each clone:
|
|
# Configure the github project, e.g.,
|
|
# git config github.project linuxcnc/linuxcnc
|
|
#
|
|
# To merge or fetch an individual pull request, just specify it by number:
|
|
# git merge-pr 144
|
|
#
|
|
# If you put a copy / symlink as git-fetch-pr, you can also
|
|
# git fetch-pr 144
|
|
#
|
|
# To act on a pull request associatred with another fork of this project,
|
|
# specify the name of the fork:
|
|
#
|
|
# git fetch-pr jepler/linuxcnc#37
|
|
#
|
|
# This script does NOT check that you are merging the pull request to the
|
|
# branch requested on github.
|
|
#
|
|
# License: CC0 https://creativecommons.org/share-your-work/public-domain/cc0/
|
|
# Also commonly called "Public Domain"
|
|
</pre>
|
|
<br><br><font size=-2>Entry first conceived on 11 October 2016, 20:16 UTC, last modified on 6 July 2019, 21:49 UTC</font>
|
|
</body>
|
|
</html>
|