Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I noticed that a lot of GitHub accounts only have repositories which are forked from other accounts. In addition the people who do this usually don't make any contributions to the forked repositories.

I've heard of people collecting stamps and seashells, but why would anybody want to collect repositories? Personally I would only fork a repository if I wanted to make some changes to it.

share|improve this question
45  
they want to ensure that they have a stable backup should the owner of the project delete his repos and disappear –  ratchet freak Jun 6 '13 at 11:26
14  
When you come to a fork in the road, take it. –  dan1111 Jun 6 '13 at 11:27
2  
@dan1111 - When you come to a fork in the road, take the one less traveled by - unless you're not Robert Frost. –  Aadit M Shah Jun 6 '13 at 11:29
6  
Simply because that's how pull requests work in GitHub (and because people are a bit fork-happy and then forget about it sometimes, or abandon their project idea and forget to get rid of the fork) –  haylem Jun 6 '13 at 11:39
1  
just a comment, as I understand they use as a "backup" of the code, but they forget (or not know) that updates the repository does not affect the "forks", when they should be doing right fork (for backup) and "Star" the repository to know when to do a "re-fork", in other words, they think "fork" is almost the same thing as "Star" and unaware maintains an outdated code. –  Guilherme Nascimento May 7 at 19:40
show 1 more comment

5 Answers

up vote 31 down vote accepted

In our line of work we tend to look for technical reasons, but in my opinion the primary reason isn't technical. If you look at GitHub Help or other GitHub tutorials, forking a repo is one of the major steps for how you "do" GitHub.

When people are learning and evaluating GitHub, just about every tutorial out there is going to tell them to fork a repo as part of that learning process. Since the primary purpose of GitHub is to contribute, a lot of people working through the standard tutorials don't realize if you just want a read-only clone you don't have to do a fork first.

share|improve this answer
13  
Along the lines of non-technical reasons: I've clicked on the 'fork' button several times hoping to see who's forked the repo, only to find that I've forked it. Ooops! Not sure if other's have done the same. –  gdw2 Jun 6 '13 at 21:27
21  
@gdw: Causing you to exclaim, "Oh, fork!" –  Ben Jackson Jun 7 '13 at 0:47
1  
I remember when I first learned about git and Github, I did some forking just because guides and tutorials seemed to propose it as the way to get your own copy of the code on your computer. –  rmac Jun 7 '13 at 9:01
add comment

As you mentioned in your question, people fork repositories when they want to make a change the code, because you don't have write access to the original repository (unless you've been added as a collaborator by the owner of the repository).

In the forked repository they have write access and can push changes. They may even contribute back to the original repository using pull requests.

I think there are multiple reasons why people fork repositories but don't change them:

  • they might fork a repository which looks cool, simply fork it (because it's easy (only one click)) and want to make a change later (and then probably forget it/didn't have time to do so)
  • they fork a repository to make a change and then discover that the change is unnecessary and forget to delete the own repository
  • they might fork a repository because one of the projects depends on an other repository (maybe via submodules) and they want total control over the repository used as a dependency (the owners of the original repository might decide to move from github to google code etc.)
  • they might simply forget to push the commits
share|improve this answer
    
When you aren't using Github, you're going the old-school route and creating a local cloned copy of the project so you can modify it. Forking on github gives you access to pull requests which are preferred by many projects. If you're on another project, you'll end up creating patches and sending those in to be reviewed. –  omouse Jun 6 '13 at 16:45
    
It's a simple one-step process to setup a remote tracking branch. Anybody who has tried to contribute to a git repository outside of GitHub knows how tedious it can be. Plus, if the original author goes AFK, you can follow the development graph to find forks that are still actively developed. Hopefully, it'll keep GitHub from degenerating into a wasteland of dead projects the same way SourceForge did. –  Evan Plaice Feb 19 at 0:03
add comment

One possible reason: they have running code that depends on those projects and their build process involves pulling the dependencies from github. Having the fork protects them against breaking changes. For projects that don't tag versions, this is the easiest way to achieve that.

share|improve this answer
add comment

The entire point of Github is "social coding".

Personally, I fork repositories when:

  • I want to make a change.
  • I think the project is interesting and may want to use it in the future, but have no easier way of saving it for later on the device I'm currently using.
  • I want to use some or all of the code in that repository as a starting point for my own project.

Now I've heard of people collecting stamps and seashells, but why would anybody want to collect repositories?

Why not?

There's nothing (that I can think of) that can go wrong from forking repositories for personal pleasure. Honestly, I keep a folder of interesting projects that I see on Github and other places simply for inspirational purposes, and partly because I'm a geek. I understand that I don't have to fork the project to read the code, but I may actually want to edit that in the future.

Now start forking.

share|improve this answer
6  
+1 for the "Why not?" section. –  Llepwryd Jun 6 '13 at 21:02
    
My additional 2 cents on the "Why not?" section: My habit is of always doing "git push" after I've finished working on a feature; it has that Q.E.D. satisfactory feeling for me (that I don't get when writing out the remote and branch name). So whenever there's even a slightest chance that I may want to do changes to the repo, I'd prefer to fork it, instead of later having to change the default "origin" repo. –  yoniLavi Jun 12 '13 at 22:31
add comment

A lot of duplicate content Google sees on github, it's probably no good to search.

It's so easy to make a fork by mistake, it doesn't even ask you to confirm that.

On the other hand, removing that fork requires significantly more clicking (and even typing).

Many of the repos are forked by mistake and of curiosity (what does this button do?) and it's easier to leave it that way than to start finding out on how to delete it.

If there was an "unfork" button in the same place...

Another thought: it's just one click and if someones sees that I've forked this genius code to work on, maybe he thinks I'm genius too.

share|improve this answer
    
this post is rather hard to read (wall of text). Would you mind editing it into a better shape? –  gnat Jun 6 '13 at 17:42
    
@gnat: I've added a few dots, but I don't think it's gonna change anything, either way the github lovers are gonna hate it. –  Czarek Tomczak Jun 6 '13 at 17:59
    
@gnat Thanks :-) –  Czarek Tomczak Jun 6 '13 at 20:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.