I have googled and found many solutions but none work for me.
I am trying to clone from one machine by connecting to the remote server which is in the LAN network.
As @ingyhere said:
Shallow Clone
First, turn off compression:
git config --global core.compression 0
Next, let's do a partial clone to truncate the amount of info coming down:
git clone --depth 1
When that works, go into the new directory and retrieve the rest of the clone:
git fetch --unshallow
or, alternately,
git fetch --depth=2147483647
Now, do a pull:
git pull --all
Then to solve the problem of your local branch only tracking master
open your git config file (.git/config) in the editor of your choice
where it says:
[remote "origin"]
url=
fetch = +refs/heads/master:refs/remotes/origin/master
change the line
fetch = +refs/heads/master:refs/remotes/origin/master
to
fetch = +refs/heads/*:refs/remotes/origin/*
Do a git fetch and git will pull all your remote branches now