Git https automatically use a username

If you cloned a git repository by saying git clone https://server.com/cyrax/doom3.git everytime you try to push to the repository it will ask you to enter a username and passwd. I did not want to setup any ssh keys as yet. Unfortunately when I try to push code to the repo it kept asking me username and password. I only wanted to enter the password.
To fix this consider cloning using https://cyrax@server.com/cyrax/doom3.git … but if you have already cloned the repo then try this
Inside the repository on your local system open the .git/config and modify the [remote “origin”].url to https://cyrax@server.com/cyrax/doom3.git
Next time you login it will only ask you for your password. BTW replace “cyrax” username with your own account name.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s