I am using GitPython to work with a remote repository. The user is providing a URL that is a file inside the repository, something like this
https://github.com/Namespace/Project/tree/master/my-folder
Is it possible to initialize a Repo from that url using something similar to this command valid for local repos? git.Repo("local_repo_path/my-folder", search_parent_directories=True)
At the moment I am looking for /tree in the url and manually cutting away the last part, using it later to recover the specific path/file, but I am wondering if there is a simpler/better way using native functions from the library.