1

I am a new user to github/git bash.

I am trying to add my project to github using git bash. Once I get to the stage of git push, username for 'github.com' appears, but I can't type in my user name. Why is this?

I also tried this by using git config --global user.name "Your Name Here"

Bob Gilmore
  • 9,708
  • 13
  • 46
  • 51
PatrickMelia
  • 87
  • 1
  • 12
  • 1
    Username during push? You're probably trying to push to a `https://` URL. The username there has nothing to do with your `user.name` and `user.email` settings. – Nils Werner Feb 27 '14 at 23:10
  • Yup, a username during push. Ah okay I see, should I try using the shh? – PatrickMelia Feb 27 '14 at 23:13
  • "I can't type in my user name" I'm not 100% certain about this, but I suspect that you actually can enter your username, but git is not displaying the characters you type for security reasons (I know for sure that it does this with passwords). Try entering your username and hitting enter anyway, even though the characters you are entering aren't showing up on the screen. – Ajedi32 Feb 28 '14 at 00:47
  • Sorry @Ajedi32, I have been pressing the keys but its not appearing all. – PatrickMelia Feb 28 '14 at 10:16
  • @PatrickMelia What do you mean by "its not appearing all"? What's not appearing? – Ajedi32 Feb 28 '14 at 14:28
  • @Ajedi32 when I am typing in my username nothing wont show up on the cmd. its the same with my password. – PatrickMelia Mar 02 '14 at 21:43
  • @PatrickMelia Okay, so I'm not sure about the username, but for the password that's exactly what's supposed to happen. Nothing you type appears on terminal for security reasons, but git is still reading in your password. Just type your password and hit enter. It should work. – Ajedi32 Mar 02 '14 at 22:05
  • @Ajedi32 got it working to a certain degree but a blank zipped file went up, with nothing in it. You wouldn't know why? – PatrickMelia Mar 03 '14 at 10:35
  • @PatrickMelia That sounds like a separate question to me. If you're saying that git pushed a single blank zip file to the remote repo, then my guess would be that that's exactly what you had committed before you pushed. Run `git status` to see what files aren't committed yet, then `git add ` to add each file to the repo, then `git commit` to commit the files, then `git push` to push them. If you have any further questions, it's probably best to post them as separate questions. – Ajedi32 Mar 03 '14 at 14:14
  • Cool @Ajedi32 thanks. – PatrickMelia Mar 04 '14 at 09:11

1 Answers1

1

You'll want to remove and re-add your github remote as the ssh url, rather than the https url. So, say you've been pushing to 'origin', and your 'origin' is "https://github.com/username/repo/repo.git". You'll want to do:

git remote remove origin
git remote add origin git@github.com:username/repository.git
git push origin branch

Otherwise, you're going to have to enter your github email address and password on each session.

Jeff Stagg
  • 45
  • 1
  • 5