ブランチごとに実行したいのですgit push
が、2つのリモートにプッシュします(ブランチごとに異なるリモートがあります)。
私は各ブランチでこれを試しました:
git remote set-url --add --push all repo1
git remote set-url --add --push all repo2
git branch --set-upstream-to=all/master
これは機能するはずですが、プロキシに問題があります。repo1
イントラネットのGitLabリポジトリにあり、プロキシを使用していませんrepo2
が、Azureにあり、プロキシが必要です。したがって、git push
失敗します。
同じリモート内のURLの異なるプロキシでこれを機能させるにはどうすればよいですか?または、この要件に取り組む方法の他のアイデアはありますか?
最も簡単な方法は、プロキシを設定するための2つのバッチファイルと、プロキシを設定解除して管理するための2つのバッチファイルを書き込むことです。
git bashで以下のコマンドを使用して、Gitプロキシを設定できます。HTTPプロキシとHTTPSプロキシの両方に設定します。
git config --global http.proxy http://username:[email protected]:8080
git config --global https.proxy http://username:[email protected]:8080
//Replace username with your proxy username
//Replace password with your proxy password
//Replace proxy.server.com with the proxy domain URL.
//Replace 8080 with the proxy port no configured on the proxy server.
Gitプロキシの設定を解除するには、以下のコマンドを使用します
git config --global --unset http.proxy
git config --global --unset https.proxy
上で私のブログをチェックアウトGitのプロキシを設定する方法とどのようにGitのプロキシの設定を解除するに詳細
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加