Git に手動でプッシュされるソース コードを現在作成している変更プロセスを自動化しようとしています。GitPythonを使用してそのコードをラップしようとしています:
from git import *
# create the local repo
repo = Repo.init("/tmp/test/repo", bare=True)
assert repo.bare == True
# check status of active branch
repo.is_dirty()
# clone the remote repo
remote_repo = repo.clone("http://user:pass@git/repo.git")
# compile source code into repository
# ...
# track untracked files
repo.untracked_files
# commit changes locally
repo.commit("commit changes")
# push changes to master
remote_repo.push()
これを実行しようとすると、
トレースバック (最新の呼び出しが最後):
ファイル「git_test2.py」の 33 行目
repo.commit("変更をコミット")
悪いオブジェクト: 636f6d6d6974206368616e676573
スクリプトはリモート リポジトリをプルできますが、コミットに失敗します。これに対するより良いアプローチはありますか?