测试版本库,随便折腾。
陈炜
2023-06-09 eabbc8c496cde4eda35e3e7553a3cda6e3329aa6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from git import Repo
import os
 
dirfile = os.path.abspath('d:/git/test')
repo = Repo(dirfile)
g = repo.git
 
while True:
    try:
        g.pull()
    except Exception as e:
        print(e)
    else:
        print("Successful pull!")
        break