Don’t fork

The gist a simple git branching model has gained much popularity lately. The author mentions some drastic changes to the normal git flow like merging changes from feature branches straight into master. This is necessary to maintain simplicity.

There are some notes to the end of the gist. Among them is one titled “Don’t fork. Push feature branches to main repo.”.

Sometimes I see people forking repositories in order to issue pull-requests. Yes, you may have to do this when contributing to open-source projects you don’t regularly contribute to. But, if you are a contributor, or working in the same org, get push rights on the repo and push all your feature branches to it. Issue pull requests from one branch to another within the same repo.

Because the whole fork and pull-request mechanism can be devastating sometimes, you don’t need to consider such sophisticated schemes for small teams. Let’s face it, only a fraction developers out there have the itch to really learn the tools they are using. You’re lucky if more than half of your team is well-versed with at least the basic git commands.

When you can afford it, it’s always a good idea to have a central repo and give everyone write permissions. You can even fine-tune the permissions to specific branches if your git server runs gitolite. AFAIK, this is not possible with github or gitlab.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *