Marcin Petrów
Marcin Petrów

Reputation: 1497

Python+Git on for remote repository

Can any one tell me how I can pull data from remote repository (custom branch) with Python? Im currently using GitPython...

Upvotes: 1

Views: 1408

Answers (2)

Sam Mirrado
Sam Mirrado

Reputation: 336

You can use the python dulwich package.

Check out this question for some direction: Programmatically `git checkout .` with dulwich

Upvotes: 2

Andy Hayden
Andy Hayden

Reputation: 375445

To clone a repository.

repo = Repo.clone_from("path/of/repo/to/pull", "path/of/clone")

This function is described more precisely in the docs.

.

In order to pull the latest, you should use the pull GitPython command:

repo.pull()

by default this should use the paths specified on instantiation as <src>:<dst>.

Upvotes: 1

Related Questions