Skip to content

Instantly share code, notes, and snippets.

@simbo1905
Created December 10, 2017 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbo1905/d57d77eb482b7fda27af4f72fc4809fc to your computer and use it in GitHub Desktop.
Save simbo1905/d57d77eb482b7fda27af4f72fc4809fc to your computer and use it in GitHub Desktop.
git replace local repo contents with new remote repo contents
# sometimes your local repo is created by some tool and you need to seed it with some other
# sample code where you don't need/want to fork the sample code. Try this:
GIT_SRC_URL=$1
remote add simplecode $GIT_SRC_URL
git pull simplecode master -X theirs --allow-unrelated-histories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment