How do I reset my master to be a copy of rails master
I forked rails and then this is what I did.
> git clone firstname.lastname@example.org:nadal/rails.git > cd rails > git remote add upstream git://github.com/rails/rails.git > git pull upstream master
Now git remote shows two items
- When I commit a project an extra project dir is created
- Github network graph not displaying correctly
- How to push into a repository different from the repository I'm pulling from
- git push origin tries to push into remote main branch instead of creating a new one
- How come my entire project is not pushed to Github?
- fatal: 'origin' does not appear to be a git repository
> git remote origin upstream
I made a bunch of changes to master and comitted it. Then I created a bunch of branches to fix a few rails things. However when I rebase against master I also get changes I did to master.
I want to discard the changes I made to master.
Since I already committed some changes to my master, how do I reset my master to be exact copy of rails master. I want to discard the committs I made to my master.
2 Solutions collect form web for “How do I reset my master to be a copy of rails master”
$ git checkout master $ git log #find version you want, let's say it's 8cdb9 $ git reset --hard 8cdb9 #master is now at version before you made changes $ git merge myFixBranch1 #assuming myFixBranch1 is a branch that you still want the changes from $ git pull upstream master #if you want to update to latest rails code
An easier way is to just visually inspect via
Once there, you can right click the node you want to go back to and select “reset master branch to here”. Choose “hard” to set your working folder to be the same as that commit as well. Close the window.
Now select merge from the menu, pick the local branch you want to merge.
Hope this helps.