Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up new github repository - unknown switch `u'

I am trying to setup a new repository on my existing GitHub account.

I followed the steps circled here:

enter image description here

When I run the command git push -u origin master, I get the following error:

error: unknown switch `u'

Any ideas as to the issue? Doing a Google search for this error didn't seem to cough-up anything useful.

like image 716
keruilin Avatar asked Sep 15 '11 16:09

keruilin


3 Answers

It seems your git client is too old. Try to update it to most recent version: http://git-scm.com/

like image 142
classic Avatar answered Nov 07 '22 10:11

classic


Ignore the error: unknown switch `u'

Try what they say here, http://help.github.com/create-a-repo/

$ git push origin master
like image 27
Kevin Avatar answered Nov 07 '22 10:11

Kevin


I believe that this:

$ git push -u origin master

...is equivalent to:

$ git push origin master
$ git config --add branch.master.remote origin
$ git config --add branch.master.merge refs/heads/master

So if you're running an older version of Git that doesn't support -u for git push, run that group of 3 commands instead.

like image 4
Tommy Stanton Avatar answered Nov 07 '22 10:11

Tommy Stanton