2

We have an on premises TFS instance that hosts our Git repositories. Using a VPN, I can git pull but cannot git push. I used to be able to git push but it seems to have stopped working. I've adjusted the buffer size for git files using git config --global http.postBuffer 157286400 but it seems like it's made no difference. The HTTP error is accessed denied (401) but cannot seem to understand why I can authenticate, pull source and used to be able to push but no longer can.

The output form git is:

Counting objects: 387, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (385/385), done.
Writing objects: 100% (387/387), 90.11 KiB | 2.82 MiB/s, done.
Total 387 (delta 320), reused 0 (delta 0)
error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

If i change the URL for origin to not include my username and password, I receive an access denied.

fatal: Authentication failed for '<git repo address>'

I'm suspecting an issue with the TFS service itself but cannot figure out if I've lost permissions or if there is some git configuration option that might need to be adjusted.

eis
  • 51,991
  • 13
  • 150
  • 199
Adam Driscoll
  • 9,395
  • 9
  • 61
  • 104
  • " HTTP 401 " indicate unauthorised access (authentication done but no permission to do action). Is there additional setting needed at server to allow push (to specific branches)? – Jayan Jan 22 '18 at 03:40
  • If you're using TFS, have you tried using Visual Studio to connect to your repo? Visual Studio will ask for credentials and maybe that will fix your settings. – Wouter de Kort Jan 22 '18 at 07:21

2 Answers2

0

Check first your git config credential.helper.

If it returns "manager", do check the Windows Credential Manager to see if the wrong credentials might be cached there.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

You could also check the if you could push to the remote url listed for your repo by

(git remote -v).

If it is no longer correct, you could also reset the remote URL by:

 git remote set-url origin <new-url>

Assuming that you remote name is origin

Danko Valkov
  • 1,038
  • 8
  • 17