Skip to content

DNET_PullRequestPublicPrivate

nishi_74322014 edited this page Sep 11, 2026 · 1 revision

PublicとPrivate Repository間でPull Requestを送信する。

概要

  • 通常、Public RepositoryとPrivate Repository間ではPull Requestを送信できない。
  • なので、Public Repositoryの作業を暫くPrivate Repositoryで行いたい場合、どうするか?的な。

詳細

手順

裏技的方法として、以下の手順で ≒ の事を実現できる。

+Public Repository を GitHub上で folk する。 +Private Repository を GitHub上に新設する。 +以下の様な手順でPrivate Repository に Public Repository を mirror する。

git clone --bare https://github.com/exampleuser/public-repo.git
cd public-repo.git
git push --mirror https://github.com/yourname/private-repo.git

※ mirror後、cloneしたローカルのPublic Repositoryは削除してしまってOK。

+Private Repository をcloneして作業する。 +Private Repository の変更をPublic Repositoryに (pull&)push する。

cd private-repo
git remote add public https://github.com/exampleuser/public-repo.git
git pull public master # Creates a merge commit
git push origin master

+Public Repository から folk 元 に GitHub上から Pull Request。

※ TortoiseGitでは「任意のURL」を使用すれば、Repository間で同期(pull&push)できる。

コンフリクト解消

参考

github.com

移行メモ

  • 元 Wiki で見出しそのものが他ページ・同ページ内へのリンクになっていた箇所は、 GitHub Wiki では見出しからアンカが生成されるため、 見出しをプレーン・テキストとし、リンクは直下の本文に置いた。
  • PukiWiki のページ内アンカ(#xxxxxxxx)は GitHub Wiki では再現できないため、 同一ページ内のアンカは見出しから生成されるアンカに張り替え、 他ページのアンカを指すリンクは「〜(ページ名 の該当節を参照)」の形に置き換えた。
  • 元 Wiki の行頭空白によるプレフォーマット・ブロックは、 フェンス付きコードブロックにした。

Tags: 移行, GitHub, Pull Request, Public Repository, Private Repository, フォーク, Git

NetDevInfraWiki

マイクロソフト系技術情報 Wiki
Open 棟梁 Wiki

(未着手)

開発基盤部会 Wiki

移行管理: DONETODO

Clone this wiki locally