Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Github asking for username/password when following the instructions on screen and pushing a new repo?

Tags:

git

github

I'm the owner of an organization on github and just created a repo and tried pushing but I'm running into an issue where it's asking me for my username even though I can SSH just fine:

$ ssh -T [email protected] Hi Celc! You've successfully authenticated, but GitHub does not provide shell access. $ git add . $ git commit -m 'first commit' [master (root-commit) 3f1b963] first commit  6 files changed, 59 insertions(+)  create mode 100644 .gitignore  create mode 100644 main.js  create mode 100644 package.json  create mode 100644 readme.markdown  create mode 100644 views/index.ejs  create mode 100644 views/layout.ejs $ git remote add origin https://github.com/WEMP/project-slideshow.git $ git push -u origin master Username for 'https://github.com': 

What am I doing wrong? This has never happened to me before but I recently also upgraded to git 1.7.10.3.

like image 726
Kit Sunde Avatar asked Jun 06 '12 06:06

Kit Sunde


People also ask

How do I stop Git push from asking for username and password?

Issue the command git fetch/push/pull. You will not then be prompted for the password.

Why does GitHub asking for username and password every time?

If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository. Using an HTTPS remote URL has some advantages compared with using SSH. It's easier to set up than SSH, and usually works through strict firewalls and proxies.

Why does Git clone Need username and password?

If the username and password are correct, the cloning of the remote repository begins immediately. However, this is not safe as the password will be in the shell (ex. bash) history.


1 Answers

Don't use HTTP use SSH instead

change

https://github.com/WEMP/project-slideshow.git  

to

[email protected]:WEMP/project-slideshow.git 

you can do it in .git/config file

like image 120
Hugo Avatar answered Oct 07 '22 02:10

Hugo