Git push asking for username and password

Von in linux, netzthetik

I fidd­led around with this issue for a vast amount of time. I bur­ro­wed into panels. I bla­med my Ubun­tu instal­la­ti­on for a bro­ken gno­me key­ring. I instal­led SSH keys ump­te­en times. Not­hing came of it. Each time I pushed the last git com­mit to Git­Hub from wit­hin the con­so­le, git asked for authorization.
Then one day acci­dent­al­ly I came across the con­fi­gu­ra­ti­on file of git loca­ted at .git/​config and a line star­ting with https://… attrac­ted my attention.
No sur­pri­se. For­cing git to con­nect to Git­Hub via HTTPS the con­so­le is unab­le to use instal­led SSH keys. For­tu­n­a­te­ly resol­ving the issue is easy. Git­Hub is offe­ring three links to a repo­si­to­ry: HTTPS, SSH and Sub­ver­si­on. Just copy the SSH link to the con­fi­gu­ra­ti­on file and replace the HTTPS URL. If you don’t want to mess around with the con­fi­gu­ra­ti­on just exe­cu­te the fol­lo­wing com­mand at the root loca­ti­on of your project:

user@pc:/my/project/$ git remote set-url origin git@github.com:username/repo.git

… whe­re git@github.com:username/repo.git would be the link obtai­ned from GitHub.
And the next git push will run through like a charm. 

Share on LinkedInShare on Redditshare on TumblrShare on StumbleUponDigg thisShare on FacebookGoogle+Tweet about this on TwitterEmail to someone