Skip to content

Instantly share code, notes, and snippets.

@RohitRathore1
Created August 8, 2020 07:59
Show Gist options
  • Save RohitRathore1/4d43434a2a0198e85f92e355fd40b292 to your computer and use it in GitHub Desktop.
Save RohitRathore1/4d43434a2a0198e85f92e355fd40b292 to your computer and use it in GitHub Desktop.
If you have messed in your fork repository after doing some changes then to avoid this problem follow these steps:
## Clean up a fork and restart it from a upstream
The simplest solution would be (using `upstream` as the remote name referencing the original repo forked):
```
git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
```
@RohitRathore1
Copy link
Author

git hacks for my work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment