Last active
August 29, 2015 13:55
-
-
Save justnom/8691472 to your computer and use it in GitHub Desktop.
Sync with a fork - this assumes no merge conflicts.
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
@echo off | |
set OLDDIR=%CD% | |
cd /d %TEMP% | |
set /p repo=Enter the forked Git repo: | |
set /p upstream=Enter the upstream Git repo: | |
:: Clone the forked repo | |
if exist "forked_repo" del /q /s /f "forked_repo" | |
git clone %repo% "forked_repo" | |
cd "forked_repo" | |
:: Add the upstream remote | |
git remote add upstream %upstream% | |
:: Merge the upstream repo and push it up to the origin | |
git fetch upstream | |
git checkout master | |
git merge upstream/master | |
git push | |
cd /d %OLDDIR% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment