Reference to this post:
Git clone over Bitbucket takes a long time even when cloning from an empty orphan branch
I used this command:
git clone repo_url . --branch some/big/master/branch --single-branch
I am trying to clone one single branch but this time, not an empty branch, it is one of the relatively big branches with many large ZIP files with the LFS feature turned on.
The cloning process seemed to work fine, but it froze for more than one hour.
Then, I pressed ctrl-x or ctrl-c to break the process, and used this command:
git fetch
git reset --hard origin/some/big/branch
It starts doing something, then it will freeze again for what looks like forever.
Any idea what is going on?
Update 1
I then closed all windows, restarted the laptop, and tried again, and it finished in 30 seconds.
Is this probably because git
needs a lot of resources to clone LFS files? I have pushed a good number of ZIP files with LFS turned on.
Update 2:
I did another round of tests with and without the --single-branch
switch. I noticed that running the clone from another colleague's laptop, with the single branch switch, is faster than without the single branch switch and it took a max of 10 seconds to complete in both cases. But, from my laptop, it took 5 minutes to complete without the single branch switch I checked Task Manager and didn't find any reference to GIT-LFS. I ran the cloning process on my laptop with the single branch switch, and it finished in 10 seconds.
So the problem is really cloning any repo without using the single branch switch, and it is on my laptop.
This means the problem is either in my laptop resources or some config that allows git
to run and exploit the available resources.
Is there some config to let git
run more efficiently?