mirror of
https://github.com/kou029w/zenn.dev.git
synced 2025-02-27 18:55:17 +00:00
69 lines
3.2 KiB
Markdown
69 lines
3.2 KiB
Markdown
---
|
|
id: github
|
|
title: GitHub 連携
|
|
---
|
|
|
|
サンドボックスを GitHub リポジトリと同期したり、サンドボックスからフォークして Pull Request を作成できます。
|
|
|
|
## GitHub からインポート
|
|
|
|
GitHub のリポジトリを元にしてサンドボックスにインポートできます。
|
|
[サンドボックスの作成ウィザード](https://codesandbox.io/s/)から、[Import Project]を選択し、インポートしたい GitHub リポジトリの URL を貼り付け、[Import and Fork]を選択します。
|
|
|
|

|
|
|
|
ブランチやサブディレクトリもサポートしており、対応する URL を指定することでインポート可能です。
|
|
|
|
### 別の方法: GitHubBox.com を使う
|
|
|
|
GitHubBox.com を使うことでブラウザーのアドレスバーから簡単にインポートすることもできます。
|
|
インポートしたい GitHub リポジトリの URL のホスト名 `github.com` を `githubbox.com` に書き換えます。
|
|
たとえば、このサイトの GitHub リポジトリ (`https://github.com/csb-jp/csb-jp.github.io`)をインポートするには、URL [https://githubbox.com/csb-jp/csb-jp.github.io](https://githubbox.com/csb-jp/csb-jp.github.io) にアクセスします。
|
|
|
|
## リポジトリの作成
|
|
|
|
:::message
|
|
サインインが必要です。
|
|
:::
|
|
|
|
サンドボックスを GitHub リポジトリとして書き出せます。
|
|
画面左端のアクティビティバーの中から[GitHub]を選択します。
|
|
|
|

|
|
|
|
[Export to new GitHub repository] ペインの中で新しいリポジトリの名前を入力し、[Create new repository on GitHub] を選択すると、新しい GitHub リポジトリへの書き出しが開始されます。
|
|
|
|

|
|
|
|
成功すると、GitHub リポジトリ `https://github.com/{自分の GitHub アカウント名}/{入力したリポジトリ名}` が作成されます。
|
|
|
|
:::message
|
|
"Unable to create the repo. Please refresh and try again or report issue." と通知され、書き出しに失敗した場合、GitHub リポジトリ側を操作して手動で片付けましょう。
|
|
:::
|
|
|
|
## リポジトリとの紐づけ
|
|
|
|
:::message
|
|
サインインが必要です。
|
|
:::
|
|
|
|
サンドボックスを GitHub リポジトリと紐づけます。
|
|
[Link to GitHub repository] ペインの中の [Link Sandbox] を選択します。
|
|
|
|

|
|
|
|
## Pull Request
|
|
|
|
:::message
|
|
サインインが必要です。
|
|
:::
|
|
|
|
紐づく GitHub リポジトリへの Pull Request を作成できます。
|
|
|
|
### コミット
|
|
|
|
コミットしたいファイルの変更を保存したら、[Changes] ペインの中の [Summary (required)] に変更内容の概要を入力します。
|
|
|
|

|
|
|
|
「ブランチを作成し PR を開始する ("Create branch csb-\* for the commit and start a PR")」を選択し [Commit changes] を選択すると変更内容のコミットの含まれるブランチが作られ Pull Request が作成されます。
|