Git clone a little bit at a time or other solutions - windows

I'm working on a Windows machine, from git bash.
We recently moved our project from a TFS server to a git repo on the same server. As far as I know, this was all done in one commit. I am remote.
When I run git clone <url> the clone will start, but at some seemingly arbitrary point (a different one every time), it will fail with:
error: RPC failed; curl 56 Recv failure: Connection was reset
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
I was thinking perhaps if there were a way to clone the repo a few files at a time, that would work. It seems unlikely that such a solution exists. I have tried increasing the http.postBuffer to 157286400, and I do not think switching to ssh is an option for us currently. A shallow clone is unhelpful, as there has only been one commit. These are the solutions I've seen elsewhere. Any help would be greatly appreciated.

Related

Terminal stuck while cloning a github repo using ssh

I've tried to clone a repo using the ssh
it loads in terminal and then abruptly sticks on a certain percentage and either remains there or throws an error -
client_loop: send disconnect: Broken pipe 173.39 MiB | 2.89 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
I've looked here tried using compression, shallow cloning and retrieving the rest, it does the same, sticks on a certain percentage,
my internet is working fine, I tried downloading other repo (with http) they download quickly.
Note that the tag "github-actions" used on this question would suggests a GitHub remote job cloning the repository in a GitHub runner on GitHub side, not on a personal macos workstation.
But assuming you are cloning on macos:
if an SSH URL git#github.com:... is an issue, check first if switching to an HTTPS URL would work better: git clone https://github.com/...
check if you can clone the same repository from a different network to rule out any firewall or ISP issue

Cloning repository from AWS Codecommit

I am currently using SSH Key to clone repository from AWS Codecommit to my local machine. My
ssh git-codecommit.us-east-2.amazonaws.com
has successfully connected.
My problem is that when I run this:
git clone ssh://git-codecommit.us-east-2.amazonaws.com.amazonaws.com/v1/repos/Project
it is cloning my project but after 100% of cloning, I keep getting this error
remote: Counting objects: 1024, done.
client_loop: send disconnect: Connection reset by peer KiB/s
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
I cannot find answers around google and hoping that someone will help me with this. What is the possible causes of these error? Thank you in advance!
Try increasing the buffer
git config --global ssh.postBuffer 1048576000
If it doesn't work then use TortoiseGit software,
It helped me when I faced the same problem like yours
Thanks everyone! its working now. Increasing postbuffer did a lot of help but in my case that is not the reason why its working. You guys should check your firewall, vpn connection or your network for their security purposes.
This site might help you resolving the issue
Git Clone Fails - fatal: The remote end hung up unexpectedly. fatal: early EOF fatal: index-pack failed

bitbucket ssh error setsockopt IPV6_TCLASS 8 Operation

I'm having issues connecting to a Bitbucket repository using SSH. I have the public and private keys set up correctly. I'm worried that the issue is due to the fact that I"m working on a Windows 10 machine. Does anyone know how to get around the following error:
*setsockopt IPV6_TCLASS 8: Operation not permitted:
repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository .
Please make sure you have the correct access rights and the repository exists.*
I know I am in the repository. I can check out different branches in the repository and commands such as "git add" and "git commit" appear to work, however, "git push" is failing due to the above mentioned error.
Thank you
Make sure to use the latest Git for Windows (2.19.1) and, as I mentioned here, try a git push -4 ...
That will force the use of IPV4, to check if that would work better.
As detailed in this thread:
For me it's an IPv6 issue.
BitBucket doesn't respond to IPv6 ssh requests, so you have to wait for it to timeout.
I fixed it by adding:
AddressFamily inet
to /etc/ssh/ssh_config and git pull responds within seconds not minutes.
The last part is only valid if you are using an SSH URL, and for git pull, but might still have an effect for git push.
As noted by xpt in the comments, WSL issue 1869 says it OK to put AddressFamily inet into ~/.ssh/config, but I've just tried it, and it was not working for me, until I put it into /etc/ssh/ssh_config instead.
Thank you everyone for your help. There were two issues causing this.
First, the IPV6 warning itself was resolved once I upgraded from git version 2.7.4 to 2.19.1.
After making this adjustment I still saw an error "Permission denied (publickey)..."
I resolved this error by moving the private key, id_rsa, to the following location:
/c/Users//.ssh/
Everything seems to be in order now.

Git push to LAN repo stalls or stops without error

Intent
I intend to establish a version control service in a windows local network.
Test Environment
I have a /root folder where there are 2 repos /foo and /bar
Attempts
I was advised to use a git-daemon service (http://git-scm.com/docs/git-daemon) but it's been more complicated to implement (and works differently) from advertised.
The first guide i found was http://railsware.com/blog/2013/09/19/taming-the-git-daemon-to-quickly-share-git-repository/. I used their git daemon options in the '/root' folder that would serve all repos contained therein:
$ git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose
I was succesful in cloning an empty repo but when I added some content this the message i got:
$ git clone git://root-ip-addr/bar
Cloning into 'bar'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
fatal: read error: Invalid argument
Receiving objects: 100% (3/3), done.
fatal: error in sideband demultiplexer
Next i found http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing-the-repository/ where they don't even mention the daemon but instead went for a local-folder-as-remote aproach. I still think I need a daemon so what I tried was making my repos bare while adding the -enable:receive-pack option on the daemon.
They advise to use branches on the client machines to commit so I did. I also committed to the master branch to see what happens. In both cases GIT seems to stall.
Here is a screenshot of the client machine attempting to push to the central hub. You can see that it stalls at that point.
Here is a screenshot of the central hub running the daemon.
I can only key in ctrl+c to stop the git daemon altogether after that.
The only way that I've actually gotten it to work was calling the daemon from inside the repo, but that would entail having to do that for every repo (i intend to establish this for hundreds of repos)
I understand that I should dedicate a couple of weeks to thoroughly understanding Git, something that I've postponed for the past 6 months, since I've been able to get by with basic clones, adds and commits.
Having said that, i think there should be more visually constructive guides when attempting to explain the git workflow metaphor.
Thank you for your time.
It seems that it is related to bug #101 (issue 457 on google code) in msysgit and a fix was introduced in Git-1.9.4-preview20140611.
Setting the sendpack.sideband config option and than push again works.
git config --global sendpack.sideband false
git push origin ...
I tried it with this git daemon command
git daemon --base-path=. --export-all --reuseaddr --informative-errors \
--verbose --enable=receive-pack

Git push not working but "git clone" and SSH does

I set up a Debian server that uses SSH for shell access and git repos. I created a bare repo on it and using ssh was able to clone it to my Windows 8 workstation, however when trying to push changes back to the Debian server I get the error depicted here:
Read from remote host 174.52.5.192: Connection reset by peer
fatal: sha1 file '<stdout>' write error: invalid argument
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git#174.52.5.192:/home/git/repos/space-junk.git/'
I use this work station regularly for shell access to the same server via SSH so I know inability to access SSH isn't the problem.
Does anyone have any idea what's going wrong?
Actually, the first push should be:
git push -u origin master
That will link the local branch master to its remote tracking one origin/master
Then, after that first push, you will be able (for all the subsequent push) to do a simple:
git push
See more at "Why do I need to explicitly push a new branch?".
I got it working! It turns out the proper command was
git push origin master
The Windows version didn't have a descriptive enough error message but I got it working by switching over to Linux, which told me my command was wrong.

Resources