Many github repos demand creating a fork on every essential code change.
Which is exactly like branching in git.
Why did github introduce forks?
(I like the idea of a git brunch - git users meeting up on a Sunday for lots of fried food ;))
The idea of forking a project on github and making changes in your own repository is that the owners of the project don't need to trust you or give you push access to their repository. If you want them to consider merging code from your repository then you can send them a pull request. GitHub has a nice system of pull requests where the upstream developers can review and comment on your contribution.
In a group of trusted developers, where everyone can push to one shared repository, you typically do push each new feature you develop as a new topic branch, and ask other people to review your work and consider it for merging.
One of the many nice things about git is that it doesn't particularly matter which repository a particular branch tip is in - that commit will always have the same SHA1sum, so you can push and pull it around as you like. It doesn't matter really if it's in a fork on GitHub or pushed to a shared repository or whatever...
To expound a bit on your question of "why can't I just push my branch to their repo?", consider that even if github made it possible for you to do this without potentially breaking the entire repo for everybody, most maintainers still would not be happy having their clean repo turn into a dumping ground for dozens or hundreds of branches.
Other contributors seeing these branches would assume that the upstream developer was working on them, even if they were really long-abandoned half-finished contributions from third parties.
The funny thing is, the workflow for you is exactly the same either way, with the addition of you clicking a "fork" button at some point on the upstream repo.
Compare:
vs
There really is absolutely no overhead for you in creating a fork.
If you already have a clone of the upstream repo, and you're worried that you'll have to make a new clone and waste some time, try this workflow:
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With