How to git fetch using gitpython?
Asked Answered
A

1

17

I am looking for a equivalent way to fetch in gitpython

git fetch --quiet --all

How can I perform git fetch in python?

Anatase answered 5/10, 2016 at 7:42 Comment(0)
A
34

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()
Abbie answered 5/10, 2016 at 7:46 Comment(1)
Also, repo.remotes.origin.fetch()Lesson

© 2022 - 2024 — McMap. All rights reserved.