Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I login to my repo using gitbash?

Tags:

github

I have added my self to the git bash program but can't find on google how to login?

$ git config --global user.name "myname"
$ git config --global user.email [email protected]
like image 608
Ben Muircroft Avatar asked Dec 30 '13 11:12

Ben Muircroft


1 Answers

The user.name and user.email have nothing to do with login credentials.
They are metadata attached to your commits.

To "login", you need to add a remote url which will use your credentials, either https or ssh one.

git remote add origin https://UserName:[email protected]/UserName/yourRepo.git
                                 ^
                                 |
                              (credentials)

Or ssh:

git remote add origin [email protected]/UserName/yourRepo.git

(which would means that you have in HOME/.ssh your id_rsa and id_rsa.pub private and public key, with the public key registered in your GitHub account: see "Generating SSH Keys")


See more at "Which remote URL should I use?".

As noted by paddymac in the comments, if origin already exists, use git remote set-url origin instead of git remote add origin

like image 91
VonC Avatar answered Nov 01 '22 07:11

VonC