简体   繁体   中英

How to git fetch using gitpython?

I am looking for a equivalent way to fetch in gitpython

git fetch --quiet --all

How can I perform git fetch in python?

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM