2

I created a git repo via the github website's "new button". Then I used git bash to set up my local repo and tried to pull my remote repo (it had the default README) but got an "access denied error", the same one seen in this question: Cannot push to git repository - permission denied

I followed https://help.github.com/articles/set-up-git#platform-windows, even reopened a new git bash session but I still get access errors on my remote repo. I chmod 777 on my local repo so it's not a local problem either.

  1. https://github.com/new to create my new remote repo.
  2. Opened git bash on my win7 computer and executed the following commands:
    1. git init in project directory
    2. git add . to recursively add all project files
    3. git commit -am "commit message"
    4. git remote add origin https://... produces "fatal: remote origin already exists".
    5. git pull origin master produces access denied error. I tried step 4 first with ssh, now I'm trying to use https.
Community
  • 1
  • 1
HukeLau_DABA
  • 2,384
  • 6
  • 33
  • 51
  • Could you provide more information, exactly what commands did you run, and what is the exact error you get? – NiKiZe Sep 02 '13 at 05:03
  • Have you done the password caching? There is a credential helper available in the URL which you have given... – Shunya Sep 02 '13 at 05:03
  • 1
    I suggest you to again carefully go through the [official documentation](https://help.github.com/articles/set-up-git#platform-windows) – chanaka777 Sep 02 '13 at 05:22
  • What does `git remote -v` say? –  Sep 02 '13 at 11:57

3 Answers3

1

I am using "GitHub for Windows" and have two Github accounts, sometimes switching from one to the other.

Similarly, I got this error:

remote: permission to .../....git denied to 93befbc3eeadfe14e.... fatal: unable to access 'https://github.com/....git': The requested URL returned error: 403

I solved the problem whithin "Github for Windows" program:

  1. Settings (small gear on the top-right corner) --> Options
  2. Log out
  3. Choose "Add account" which is, in fact, the same as "log in". Then used the right account (which the respective repository is belonged to).
Alisa
  • 2,892
  • 3
  • 31
  • 44
0

To get push permissions I would use the ssh protocol/uri when doing the first git clone (since that avoids some config troubles)

Edit: To possible fix the issues you are now having check your uri since it might be as simple as a spelling mistake
Check current configuration with git config -l
Possibly change with git remote set-url origin git@github.com:path/torepo.git See more here.

Community
  • 1
  • 1
NiKiZe
  • 1,256
  • 10
  • 26
  • I never did a git clone nor do I need to now. That was never one of my commands. I created the git repo via github's site using the "new" button. Then I did everything in git bash(init, add, commit, pull) – HukeLau_DABA Sep 02 '13 at 05:03
  • Check with git remote show , as to what it is pointing to and set the remote as applicable – Shunya Sep 02 '13 at 05:25
  • @user1562655 `git remote show` will only return `origin` so not much help, did you mean something else? – NiKiZe Sep 02 '13 at 05:30
  • I installed the git-credential-winstore and ran it but when pulling or pushing code I am still prompted for my username and password, why? – HukeLau_DABA Sep 02 '13 at 05:42
  • @HukeLau_DABA https and ssh are different authentication methods, as documented in "Set up Git" that you linked to `Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication. This guide offers help generating and using an SSH key pair.` – NiKiZe Sep 02 '13 at 05:58
0

Try

git pull origin master

and then

git push origin master
Jicksy John
  • 169
  • 1
  • 2
  • 13