プライベートレポをパッケージとしてgolangにインポートしようとしています。した:
git config --global [email protected]:.insteadOf https://github.com/
したがって、理論的には、httpsへのすべての参照はsshバージョンに置き換えられます。
github.com/XXX/util
goモジュールである私のプライベートリポジトリです。
私はgo get -vを実行して取得します:
[gabriel@xiridio backend]$ go get -v
go: finding module for package github.com/XXX/util
go: downloading github.com/XXX/util v0.0.0-20200411022955-454673685ff5
go: finding module for package github.com/XXX/util
main.go:12:2: github.com/XXX/[email protected]: verifying module: github.com/XXX/[email protected]: reading https://sum.golang.org/lookup/github.com/!X!X!X/[email protected]: 410 Gone
server response:
not found: github.com/XXX/[email protected]: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/f1fdc5cc42a6995f954688df06783c05d28e4a60e9aaf6930a88a2487b913907: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
「バージョン」の問題があり、何らかの理由でhttpsへの参照がまだあるようです。他に何ができますか?
念のため、git configコマンドには引用符を使用することをお勧めします。
git config --global url."[email protected]:".insteadOf "https://github.com/"
以下が含まれます:
を使用する代わり
[email protected]
に、GitHubアカウントで個人用アクセストークンを生成し、リポジトリへのアクセスを許可してから、代わりに以下を使用することもできます。git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
また、「go get
GitHubプライベートリポジトリの「ターミナルプロンプトが無効になりました」エラーが発生する」も確認してくださいGOPRIVATE
。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加