Skip to content

Instantly share code, notes, and snippets.

@apahim
Created October 9, 2017 10:18
Show Gist options
  • Save apahim/80487e951c71f3acb3632a375b30b69b to your computer and use it in GitHub Desktop.
Save apahim/80487e951c71f3acb3632a375b30b69b to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "${1}" ]
then
echo "Please provide usernam:branch of your fork."
exit 1
else
fork_user=$(echo ${1} | cut -d ":" -f 1)
fork_branch=$(echo ${1} | cut -d ":" -f 2)
fi
if [ -z $fork_user -o -z fork_branch ]
then
echo "Please provide usernam:branch of your fork."
else
git checkout master
git pull upstream master
git merge -S --no-ff $fork_user-$fork_branch -m "Merge branch '$fork_user-$fork_branch'" -m "Signed-off-by: $(git config --get user.name) <$(git config --get user.email)>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment