rebase tree and enable clone function only

use libgit2 to clone
I tested http and https. it works