Skip to content

Instantly share code, notes, and snippets.

@tomjenkinson
tomjenkinson / gitreqrebase
Last active December 25, 2015 04:19
Allows you to rebase a pull request for example
#!/bin/bash
git remote | grep upstream > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo This script assumes you have upstream set as the repo to hand reqs in
exit
fi
if [ ! -d .git ]; then
echo This script assumes you are in the root of a repo clone
@tomjenkinson
tomjenkinson / gitreqapply
Last active October 10, 2015 13:48
A simple script to apply a pull request
#!/bin/bash
git remote | grep upstream > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo This script assumes you have upstream set as the repo to hand reqs in
exit
fi
if [ ! -d .git ]; then
echo This script assumes you are in the root of a repo clone
exit
@tomjenkinson
tomjenkinson / gitreq
Last active November 15, 2016 17:32
Simple script to create a pull request
#!/bin/bash
git remote | grep origin > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo This script assumes you have origin set as the repo to create reqs in
exit
fi
upstreamname=`git remote -v | grep upstream | grep fetch | sed "s#upstream.*github.com[:/]\(.*\)/.*#\1#"`
reponame=`git remote -v | grep origin | grep push | sed "s#.*/\(.*\)\.git.*#\1#g"`
myname=`git remote -v | grep origin | grep fetch | sed "s#origin.*github.com[:/]\(.*\)/.*#\1#"`