add function to clone or rebase a folder