私はローカルのgitリポジトリを持っています。私はgitpythonライブラリを使用してローカルのリポジトリをコミットするためにPythonを使用しています。コミットをgithubにプッシュしたいgitpythonや他のライブラリを使ってどうすればいいですか? 私はオンラインで見ましたが、解決策はありませんでした。誰もがこれで私を助けることができます。予め おかげpythonを使ったgit push
-1
A
答えて
1
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()
+3
このコードスニペットは、([説明を含む]問題を解決できるが、HTTP ://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers)は本当にあなたの投稿の質を向上させるのに役立ちます。将来読者の質問に答えていることを覚えておいてください。そうした人々はあなたのコード提案の理由を知らないかもしれません。 [レビューから](https://stackoverflow.com/review/low-quality-posts/15052961) – Ferrybig
関連する問題
- 1. git push origin masterとgit pushの違い
- 2. cf pushとgit push on Bluemix
- 3. Git pushコマンド
- 4. Git Push Not Working
- 5. git push to branch
- 6. バックデートでgit push
- 7. git post-push hook?
- 8. Git push failed:403
- 9. strange git pushエラー
- 10. Git push reminder/helper?
- 11. Git push without pull
- 12. Git push upstream
- 13. Heroku - git push
- 14. TFS 2015ビルドがGIT PUSHで固まった
- 15. git force pushの後でも間違ったコードでのアプリケーション
- 16. "git push origin master"フリーズ
- 17. Git push to Googleクラウドコンピューティングエンジン
- 18. "git push":スラッグコンパイルがハングアップ
- 19. 'git push origin master'フリーズ
- 20. Git push to remote directory?
- 21. Git push to remote fail
- 22. git push操作エラー
- 23. Git push to live ssh
- 24. Bitbucket git push as user
- 25. Heroku-Git push without building
- 26. regluar 'git push'出力からのHeroku 'git push'出力の解読
- 27. git push originとgit push origin masterの違い
- 28. git pushで正しいgitアカウントを使用するには?
- 29. Azure git pushを返す403
- 30. ポート転送(SSHトンネル)を使用したgit push
https://gitpython.readthedocs.io/en/stable/reference.html#git.remote.PushInfo – hjpotter92