Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like that SourceForge can also let people browse your code using Git. But, before I even set up the project on SourceForge, I had a GitHub repository for it. Now that I have created my SourceForge project, I had the option to use the Git tool. The problem is when I did that it made a new repository from scratch. I would like to use my existing GitHub repository with my SourceForge project, is this possible? As of now the SourceForge project has no files, so the button on the summary page, instead of a 'Download' button, is a 'Browse Code' button, but the button leads to an empty repository.

So I am wondering, is it possible to link my SourceForge project with my existing GitHub repository, or do I need to remove the 'Code' tool from my SourceForge project and just leave a link to my repository in the description?

share|improve this question
@patches has the correct answer. You'd want to mark that as the right answer. – ShaggyInjun Feb 5 '13 at 3:38
up vote 7 down vote accepted

AS the other posters pointed out, you can add more than one remote then simple push to each.

There is a better way, though, of creating merged remotes to where when you push to your remote, it actually pushes to two remotes. This answer has the detailed steps:

share|improve this answer

Certainly, simply set up a new remote in your local Git repository, that points to your Sourceforge repository. Suppose you have named this repository sf. Then simply:

git push sf master

will push the master branch to the sf remote. If you've set everything up correctly, a copy of your repository will be pushed into Sourceforge. You may then push any other, or all, branches/tags as desired.

share|improve this answer

You can't, as far as I can tell.

Sourceforge has its own GIT Server and GitHub maintains it's own.

  • You could manually push to each repo everytime you push.

    git remote add origin SF_URL
    git push origin master
    git remote rm origin
    git remote add origin GITHUB_URL
    git push origin master
  • You could use some automatic syncing like this post suggests.

P.S. You should be able to automate this with Batch / Shell script. This way you can run one script and wait till it is done. This could get complicated when you have confliting changes and you have to merge though !!

share|improve this answer
Ok, I don't care about the downvoting as much, but you have left me in darkness here. I have shared what I know, would it not be fair to expect you to share what you agree / disagree, what you found useful and what is worthless in the above answer ? – ShaggyInjun Feb 5 '13 at 2:19
Just a note, you can have more than one remote set up at the same time, origin is just the default name set up after cloning. There's no need to change what origin points to every time you want to push somewhere else. I frequently have origin pointing to my repo on my own server and github pointing to the repo on Github. If I used Sourceforge, I would add another remote pointing to that repository. – Greg Hewgill Feb 5 '13 at 3:14
I was hoping somebody would tell me I could, didn't feel right that I have to remove the origin everytime. But, those are the commands I have used when I did a similar thing. Thankyou. – ShaggyInjun Feb 5 '13 at 3:36

Your Answer


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.