Last active
November 2, 2018 11:22
-
-
Save naXa777/349f9ff1b2cebfcf87a31966d7b28dd9 to your computer and use it in GitHub Desktop.
Git Sync Fork - a shell script for syncing a fork of a repository to keep it up-to-date with the upstream repository
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
#!/bin/bash | |
# | |
# Before you can run this script, you must configure a remote that points to the upstream repository in Git. | |
# example from .git/config: | |
# ``` | |
# [remote "origin"] | |
# url = [email protected]:naXa777/tutorials.git | |
# fetch = +refs/heads/*:refs/remotes/origin/* | |
# [remote "upstream"] | |
# url = https://github.com/eugenp/tutorials | |
# fetch = +refs/heads/*:refs/remotes/upstream/* | |
# ``` | |
# | |
# Help articles: | |
# | |
# - https://help.github.com/articles/syncing-a-fork/ | |
# - https://help.github.com/articles/configuring-a-remote-for-a-fork/ | |
pwd | |
git fetch upstream | |
git checkout master | |
git merge upstream/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment