Fix up git helper scripts
This commit is contained in:
parent
1f2acc33bc
commit
eede8679e7
|
@ -35,7 +35,7 @@ fi
|
||||||
echo "Stashing any changes to files..."
|
echo "Stashing any changes to files..."
|
||||||
echo "Don't forget to update and push 'master'!"
|
echo "Don't forget to update and push 'master'!"
|
||||||
# GOJF Card
|
# GOJF Card
|
||||||
git stash
|
[[ $(git stash) != "No local "* ]] && HAS_STASH=1
|
||||||
|
|
||||||
COMMIT=$( git log --format="%H" -n 1 )
|
COMMIT=$( git log --format="%H" -n 1 )
|
||||||
|
|
||||||
|
@ -46,16 +46,26 @@ git clean -d -f
|
||||||
if [[ $BRANCH == "master" ]]; then
|
if [[ $BRANCH == "master" ]]; then
|
||||||
|
|
||||||
# Don't lose upstream changes!
|
# Don't lose upstream changes!
|
||||||
mfup
|
git fetch upstream
|
||||||
|
|
||||||
# Allow working directly with the main fork
|
# Rebase onto latest master
|
||||||
echo
|
if git rebase upstream/master; then
|
||||||
echo -n "Pushing to origin/master... "
|
|
||||||
git push -f origin
|
|
||||||
|
|
||||||
echo
|
# Allow working directly with the main fork
|
||||||
echo -n "Pushing to upstream/master... "
|
echo
|
||||||
git push -f upstream
|
echo -n "Pushing to origin/master... "
|
||||||
|
git push -f origin
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo -n "Pushing to upstream/master... "
|
||||||
|
git push -f upstream
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "Merge conflicts? Stopping here."
|
||||||
|
exit
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
@ -114,6 +124,4 @@ rm -rf ${TMPFOLDER}
|
||||||
# Go back to the branch we started from
|
# Go back to the branch we started from
|
||||||
git checkout $BRANCH
|
git checkout $BRANCH
|
||||||
|
|
||||||
if [[ $BRANCH != "master" ]]; then
|
[[ $HAS_STASH == 1 ]] && git stash pop
|
||||||
git stash pop
|
|
||||||
fi
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ if [[ $BRANCH != $TARG ]]; then
|
||||||
else
|
else
|
||||||
echo "No such branch!"
|
echo "No such branch!"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
git reset --hard upstream/$TARG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in a new issue