问题
Our BitBucket repo has grown to over 3 gigs and now when I try to clone in SourceTree all I get is the trying to connect symbol. When I try in Tortoise it clones to a certain point then disconnects saying it expected # bytes but got #.
I can't download the .zip from BitBucket because it's too large. What can I do to clone?
回答1:
Clone to an old revision, using hg clone -r <revision>
, and pull the rest. You can also pull progressively, if necessary.
回答2:
I also experienced this problem with a very large, multi-gigabyte repository that was stored on BitBucket. If I tried to simply clone the entire repo, it would always abort in the middle of "adding file changes". If you're using TortoiseHG the error message resembles "abort: stream ended unexpectedly (got ##### bytes, expected ######)"
The solution is to "get the party started" by only cloning the first few hundred check-ins, and then progressively downloading more revisions using the Mercurial pull
command.
Here's the command line:
hg clone -r 500 https://Someone@bitbucket.org/MyCompany/MyRepoName MyDevFolder
This will clone the first 500 revisions (-r 500
) of the repository named MyRepoName
, and then copy them into a new folder named MyDevFolder
. (You can, of course, omit the "MyDevFolder" and it will simply create a new folder based on the name of your repository)
If the above is successful, change into your new development folder and try to progressively update to higher revision numbers.
cd MyDevFolder
hg pull -r 1000
hg pull -r 2000
hg pull -r 3000
...
hg pull -r [Whatever the maximum number of revisions is]
hg pull
hg update
As a precaution, near the end of the process you should issue a simple hg pull
to ensure that you have pulled all of the code in its entirety.
The hg update
will, of course, update the files in your MyDevFolder
to reflect the most recent version available of the source code.
来源:https://stackoverflow.com/questions/24466958/mercurial-repo-too-large-cant-connect-clone