How to git fetch using gitpython?

11,543

The fetch method is equivalent to issuing git fetch. Accordingly, you can fetch all your remotes by iterating and fetching each individually:

repo = git.Repo('name_of_repo')
for remote in repo.remotes:
    remote.fetch()
Share:
11,543
devops
Author by

devops

I am a Devops enthusiast , working on Jenkins, Gerrit, Git, Crucible, Artifactory, Puppet and Sonarqube

Updated on June 19, 2022

Comments

  • devops
    devops about 2 years

    I am looking for a equivalent way to fetch in gitpython

    git fetch --quiet --all
    

    How can I perform git fetch in python?