私は、ユーザーが git などの基本的なアクションを行うための小さなプログラムを作成しようとしています。また、プライベート リモート リポジトリのクローンを作成するには、多くの問題に直面しています。
次の構成があります: Python 3.4 Windows GitPython Ssh 接続がリモート サーバーに確立されました。
これが私のコードです:
print(blue + "Where to clone repos ?")
path_repo = input(cyan + "> " + green)
try:
assert os.path.exists(path_repo)
except AssertionError:
print(red + "Path does not exist")
continue
print(blue + "Name of Repos :")
name_repo = input(cyan + "> " + green)
remote_path = "git@dev01:/home/git/repos/{0}.git".format(name_repo)
local_path = "{0}/{1}".format(path_repo, name_repo)
# Repo.clone_from(remote_path, local_path)
repo = Repo.clone_from(remote_path, local_path)
#print(repo.git.fetch())
#print(repo.git.pull())
#print(repo.git.status())
それはエラーを発生させませんが、スクリプトは最後に停止し、端末をブロックします(なしで無限の空の行を与えてください>>>
)
それを実行した後、Git Bash に移動して入力git status
すると、ブランチが作成されていないようで、単に init と入力します。そのため、コードの最後の 3 行を追加して、何が変更されているかを確認しますが、何も変更されていません。
Git Bash で と入力git pull
すると、彼は master ブランチをうまくプルします...
誰かが私の問題を解決できる場合は、お願いしますか?
どこでエラーを起こしましたか?
ありがとう