How do I re-grab a forked Git repo without deleting and re-forking?
git, github
Solution
Never make your own changes in master branch you should create a new branch do your changes and push it. Anyways if you want to make your branch equal to the remote one do: Assuming you have the upstream as a remote `git fetch upstream` `git checkout -f -B master upstream/master`
The checkout command above would be if branch master is there go ahead and overwrite it with upstream/master if its not there create it from the upstream/master.
If you dont have upstream added as a remote use `git remote add upstream repositoryurl`
EDIT: it should be -B
EDIT: `git reset --hard upstream/master` is more appropriate actually
Problem
Here's the scenario: I fork someones repository from Github and clone it to a local directory. I make a change, commit it and push it to my forked repository. I then send a pull request to the original repository, but it gets rejected for whatever reason. The original repository then gets some commits from other people, leaving my forked version out of date. Now, how do I get the latest version of the original repo (onto my forked repo and locally)? And also, how do I delete my commit history off Github for my rejected commit?