Sam*_*Sam 5 git git-push python-3.x gitpython
我有本地 git 存储库。我正在使用 python 使用 gitpython 库提交本地存储库。我想将提交推送到 github。我如何使用 gitpython 或任何其他库来做到这一点。我在网上看了,但没有可用的解决方案。谁能帮我这个。提前致谢
from git import Repo,remote
rw_dir = 'path/to/your/local/repo'
repo = Repo(rw_dir)
'''Enter code to commit the repository here.
After commit run the following code to push the commit to remote repo.
I am pushing to master branch here'''
origin = repo.remote(name='origin')
origin.push()
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9532 次 |
最近记录: |