I'm having a strange issue when trying to clone a local repository on a build server.
My repository lets say is at /opt/git/repos/my_repo.git
Doing a git clone /opt/git/repos/my_repo.git
is very fast
However if I edit my .gitconfig
Add the following:
[url "/opt/git/repos/"]
insteadOf = "gitserver:"
Then try:
git clone gitserver:my_repo.git
this is very slow
UPDATE:
The flag --local or -l have no effect. Git seems to default to a remote repository.
In fact it treats the gitserver: alias as a remote git server. Does any have a workaround for this issue? Thanks!
Just a guess, it may be trying to lookup "/opt/git/repos" in DNS. Perhaps try [url file:///opt/git/repos/]
. Still might not work though if it's actually trying to lookup gitserver instead. You also may want to use the --local flag.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.