Sourceforge – Cloning a local git to the remote git (Multiple git)

My local git had origin as github

I wanted to clone the github git to sf. Apparently it didnt allow me to. So I had to get my local repo up. The remote origin was reserved for github.

So I setup a remote first:

On Local machine

mkdir sourceforge/bashscripts

git init[/code]

git config user.name "sourceforgeusername"[/code]

git config user.email "sourceforgeusername@users.sourceforge.net"[/code]

git remote add origin http:[email protected]/p/supernovarom/bashscripts
[/code]

cp /dzbin/* ./[/code]

Since this is brand new, there needs to be a first commit of everything.[/code]

To list everything being tracked:[/code]

git status[/code]

Add everything in working dir:[/code]

git add .[/code]

Now, first commit:[/code]

git commit -m "Initial commit."[/code]

[/code]

git push origin master
[/code]


[/code]


[/code]

Now, for directly working on three different gits at different locations (github was already active. I just had to add sourceforge git)[/code]

Create a git from sourceforge admin menu, keep the name for ref.[/code]

First nav to path where existing git is found, on local machine[/code]

cd ~/android/kitchen/Android-Kitchen/
[/code]

git status
[/code]

Try:[/code]

[/code]

remote add origin ssh:[email protected]/p/projectunixname/kitchen[/code]

fatal: remote origin already exists.[/code]

Yup, we need a different handle. Let it be sf.[/code]

git remote add sf ssh:[email protected]/p/projectunixname/kitchen[/code]

Try:[/code]

git push origin sf[/code]

[/code]

Error:[/code]

You just tried to push to origin (on github), the remote you just added on sf![/code]

git push where_to_push source_to_push[/code]

That's because I need to merge both streams and push all my changes[/code]

git config branch.master.merge refs/heads/master[/code]

git push sf master[/code]

Done! And it immediately appears in the git![/code]

[/code]

git config branch.master.remote sf[/code]


[/code]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.