2

I wanted to make a new repository on github and after following the initial steps, when I came to this step : git push -u origin master I get the following error :

error: The requested URL returned error: 403 while accessing https://github.com/sjs7007/wget-nptel-download-script.git/info/refs 

fatal: HTTP request failed

2

1 Answer 1

1

The HTTP 403 return code means that the access is forbidden, often because of bad credentials or wrong GIT version. Chances are that you mistyped your password.

To prevent these errors you can use the GIT credential helper which will keep your password in memory for some time and avoid you to type it every time you commit something through HTTP :

git config --global credential.helper 'cache --timeout=3600' 

Where 3600 is the number of seconds you want your password kept in memory.

The best (and most secure) way to commit to github (and GIT repositories in general) remains SSH, you don't have to memorize your password (excepted if you set a password on your SSH private key) and you are automatically authenticated to GitHub repositories, see their help page about SSH keys.

Sign up to request clarification or add additional context in comments.

4 Comments

Could you tell me the exact steps? I am a beginner and I have no idea how to it, I just followed the steps presented by github.
Did you follow this tutorial ? It's a bit more detailed than the instructions left when you create a repository. Anyway, once you have defined your origin repository with git add remote origin https://github.com/..., when you do your git push -u origin master it will ask you for your GitHub username (sjs7007 given your question), and password. You have to fill them both to be able to push to your repository, the credential helper is only there to avoid you to type your credentials every time you push something.
I followed these instructions(dl.dropbox.com/u/19182824/gh2.png) I even tried the tutorial you mentioned, it gave the same error. Also when I tried earlier I used to get popups for password(which I didn't enter right any time, then an public key error would occur) which I don't get now.
Ok. Did you check that your GIT version is >= 1.7.10 (see the link in my edited answer) ? If the HTTP protocol is not a requirement for you (e.g. if you are behind a proxy or a firewall which block outgoing SSH or GIT), you should try either the GIT protocol (with origin at git://github.com/user/repo.git) or even better, the SSH protocol (again, see the link in my answer).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.