Fork gives us awesome power to suggest improvements to open-source projects, but it also can be used in enterprise scenarios.
In this example I’ll review the most common scenario when a user will make some improvements for open-source project.
We can fork repo directly from BitBucket GUI:
After repo is successfully forked, typically we can see an origin (our fork) but not an upstream (original repo):
So let’s add an upstream and check results:
Now, when code in upstream is changed we’ll be able to pull changes (that’s the main aim of upstream adding):
Let’s create our new-feature branch and add our new code to it:
Now we can share our work with project owner by creating pull request:
Owner of the original repo can review your code and merge to some branch:
And if your feature is useful it can become a part of the product by merging to the master branch:
For GitHub procedure it is almost the same, but you’re not able to create new branch so simple as in BitBucket: