Let’s say that I’m forking repo
After the repo has been forked to my repository I will clone it on my local machine.
cd rails and execute
git remote -v . This is what I see.
Now I will add
upstream remote by executing following command.
After having done that when I execute
git remote -v then I see
Now I want to make some changes to the code. After all this is why I forked the repo.
Let’s say that I want to add exception handling to the forked code I have locally.
Then I create a branch called
and make all your changes in this branch.
The key here is to not to make any changes to
I try to keep master of my forked repository in sync with the master of the original repository where I forked it.
So now let’s create a branch and I will put in all my changes there.
Gemfile I will use this code like this
A month has passed. In the meantime rails master has tons of changes. I want those changes in my
exception-handling branch. In order to achieve that first I need to bring my local master up-to-date with rails master.
I need to switch to master branch and then I need to execute following commands.
Now the master of forked repository is in-sync with the master of
rails/rails. Now that master is up-to-date I need to pull in the changes in master in my
Now my branch
exception-handling has my fix on top of rails master.