Fork is another way of saying clone or copy. The term fork (in programming) derives from an Unix system call that created a copy of an existing process. So unlike a branch, a fork is independent from the original repository. If the original repository is deleted, the fork remains. If you fork a repository you get that repository and all of its branches.
As DVCS hosting evolved, the term fork evolved. The Bitbucket software adds management to forks; forking a repository in Bitbucket has functionality you normally wouldn’t associate with a simple DVCS clone. For example, on Bitbucket, you can always see which repository the fork came from. This isn’t the case with a DVCS clone on your local system.
A comparison of branching and forking
- You don’t want to manage user access on your repository.
- You want fine-grain control over merging.
- You expressly want to support independent branches.
- You want to discard experiments and changes easily.
The Bitbucket team recommends branching for development teams on Bitbucket; We use a modified form of Vincent Driessen’s GitFlow technique. Bitbucket branches are useful when:
- You have a small group of programers who trust each other and are in close communication.
- You are willing to give the development team write access to a repository.
- You have a rapid iteration cycle.