git - Change Remote Origin

Sometimes it's the little things that eat up your day.  So here's a simple howto for all of you git users (LOVE github), to let you change you're remote origin.  Sometimes when creating a new repository it dawns on your that you misspelled something or you just changed your mind.  In my case, I am changing all of my repository names from "some nickname" to "clientdomainname.com" this makes it ultra easy for new employees to get familiar with our code sharing process.

Step 1 - Change the repository name

If you click on your repository in gitHub you will see an "Admin" link in the top right of the interface.  Once you click Admin one of the first fields you will see is the repository name, if you change this value and click "rename" you will have step 1 done... Boom.

Step 2 - Change the Config data in git

Issue the following commands filling in YOUR data and you should be set to go

$ git remote rm origin
$ git remote add origin git@github.com:username/repositoryName.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
 
Boom, easy peezy, short and weezy

Say Hello

Near the Cleveland, Akron or Medina area and want to stop by our office? Let us know and we'll get the coffee and whiteboards ready. :)