1

I am trying to push code into Github using command,

git push -u origin master

But it is asking for username and password and when I enter username and password it is giving error as "remote: Invalid username or password." enter image description here

My username is "saekhan". I tried this with saekhan, "saekhan", @saekhan and "@saekhan". Please tell me where am I doing wrong?

S.R.KHAN
  • 25
  • 5

2 Answers2

0

One possibility is that your password includes a special character.
Then you should need to percent encode it (see "Percent-encoding reserved characters")

Check also your git config credential.helper: with a recent Git, it should ask your credentials through a popup window to cache them in the Windows Credential Manager

git config credential.helper

Make sure you are using the latest Git for Windows.

I see a https://github.com/saekhan/node-course-2-web-server, so make sure your remote url is set to that repo:

git remote add origin https://github.com/saekhan/node-course-2-web-server
# or
git remote set-url https://github.com/saekhan/node-course-2-web-server
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

To be sure, you have read/write permissions to repository.

Check remote server:

git remote -v

At Git source code folder (at same level at where you seen hidden folder named .git)

git config user.name "YourFullName"
git config user.email "your_email_address@example.com"

then retry.

Vy Do
  • 46,709
  • 59
  • 215
  • 313