Unable to push to remote after committing files
まだ誰も着手していません。
評価
調査の方向性
まず、リポジトリに設定されている origin URL と remote.push の呼び出しを調べ、次に、提供された RemoteCallbacks と UserPass の認証情報がどのように使用されているかを確認します。示されている pygit2 コードで未対応の URL プロトコルエラーを再現し、remote の設定を対応しているプロトコルと比較します。設定または callback の問題を特定し、検証済みの push 成功を文書化できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I am committing some files using pygit2 and want to push to remote branch.
This is what i am doing:
repo = pygit2.Repository(build_dir)
branch = repo.lookup_branch(local_branch)
repo.checkout(branch)
for fl in files:
repo.index.add(fl)
repo.index.write()
message = f"Commiting files {files}"
tree = repo.index.write_tree()
parent, ref = repo.resolve_refish(refish=repo.head.name)
author = pygit2.Signature("user", "email")
commiter = pygit2.Signature("user", "email")
repo.create_commit(
ref.name,
author,
commiter,
message,
tree,
[parent.oid],
)
remote = repo.remotes["origin"]
callbacks = pygit2.RemoteCallbacks(pygit2.UserPass("username", GITHUB_PERSONAL_ACCESS_TOKEN))
remote.push(['refs/heads/master'],callbacks=callbacks)
And i get an error:
_pygit2.GitError: unsupported URL protocol
I cannot find any documentation or any clarity on whats going on here.
Any help will be much appreciated.
thanks
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/pygit2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·