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
git init[/code]git config user.name "sourceforgeusername"[/code]git config user.email "firstname.lastname@example.org"[/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]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]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]
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.