2

I have TFS server with a GIT repository, and I want to execute a tool over the data in the repo and generate documentation. I tried everything step by step in my local machine, in the server, and with a build in TFS.

  1. git clone https://ale:pass1@tfsserver.com/tfs/Prd_Development/Develop/_git/ACSF_APEX_API_Docu -b develop

  2. Execute the tool that generates files and copies it to the repo path

  3. git add

  4. git commit -am "mycommit"

  5. git push

In my local machine everything and directly in the server works properly but in a TFS build, when I want to push the changes I get this error

C:\Users\ale\Documents\ACSF_APEX_API_Docu>git push origin develop
Counting objects: 6241, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3420/3420), done.
Writing objects: 100% (6241/6241), 1.73 MiB | 2.76 MiB/s, done.
Total 6241 (delta 3732), reused 4640 (delta 2598)
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

But I realized that if I only add a few files I can perform the push.

I have read many post with the same or similar issue but all the solutions are not working in my case:

postbuffer: I raised the buffer but still not working. Anyways it's working on my local machine, so I think the buffer is not the problem.

remote origin Also I checked that and the remote origin is set properly (also I clone the repository so it's Ok). Also in this post are talking about Windows Credentials. In my server are not set, so I also tried setting my credentials with no success.

Wrong user password Also checked, but discarded because I'm able to clone the repo

I can't understand what's going on because in my local machine works perfect but not in the TFS server

TY guys, any help will be appreciated.

Alezis
  • 1,182
  • 3
  • 13
  • 25
  • Do I understand it correctly, that your origin is cloned via HTTP(S)? Have you any other access protocol to the repository? – petrpulc Jun 27 '18 at 14:53
  • With http, git clone – Alezis Jun 27 '18 at 14:55
  • Possible duplicate of https://stackoverflow.com/questions/12544142/git-error-rpc-failed-result-22-http-code-401-fatal-the-remote-end-hung-u – petrpulc Jun 27 '18 at 14:56
  • 1
    Seems you do not have a permission to commit to the remote repository. – petrpulc Jun 27 '18 at 14:58
  • Im able to perform a commit from my local machine with the same user Im using in the server. The possible duplicated is one of the post I referenced and is not working in my case, I tried all mentioned in that post – Alezis Jun 27 '18 at 15:00
  • Yes, you can commit to your local copy of the repository, because that is how Git works - it is a decentralized system. You cannot push, because you (presumably) do not have a permission to create commits on the remote end (tfsserver.com) – petrpulc Jun 27 '18 at 15:12
  • Sorry I mean push, I can push from my local machine to the git repo in TFS. That's why I cant understand what's going on, I can push from my local but not from the TFS server. Using the same user – Alezis Jun 27 '18 at 15:13
  • Are the repository and the tool on the same server? If so, you can clone it directly on the filesystem. – petrpulc Jun 27 '18 at 15:20
  • Yes. I did many test and I think it should be something related to the number of objects(not files) Im trying to push 6241. Because if i try to push 3 objects (one file) it works – Alezis Jun 27 '18 at 15:24
  • @AleXis can you pus changes to TFS git repo now? – Marina Liu Jun 28 '18 at 06:25
  • Not yet. I 'm trying to do it with ssh. Because I cant figure out why it's not working with http – Alezis Jun 28 '18 at 07:20
  • @AleXis Have you also cloned the TFS git repo to the TFS server before executing git push? – Marina Liu Jun 28 '18 at 09:38
  • Yes, as I said in the post, first I clone the repo in the tfs server without problem, then I add many files to the repo, then commit, and then push. The push only fails when there are a lot files (Writing objects: 100% (6241/6241), 1.73 MiB | 2.76 MiB/s, done.) and "git config --global http.postBuffer 1048576000" is not working in my case – Alezis Jun 28 '18 at 09:53

1 Answers1

0

If the 'remote' (actually, it is better to call it a bare repository) repository is on the same machine, you might be able to clone it directly on the filesystem by git clone <PATH>. This will get around any possible issues connected with RPC.

Otherwise, I would recommend setting up OpenSSH (https://learn.microsoft.com/en-us/vsts/git/use-ssh-keys-to-authenticate?view=vsts).

petrpulc
  • 940
  • 6
  • 22