6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

forkしたリポジトリを更新する手順

Posted at
  • メモ
  • Kubernetesの翻訳プロジェクトであるKubernetes/websiteが自分のリポジトリにforkしてあることが前提
  • 日本語訳を進めているブランチ「dev-1.14-ja.1」をforkしたリポジトリに反映させる

手順

  • forkしたリポジトリをクローン
$git clone https://github.com/XXXXXXXX[アカウント名]/website.git
  • fork元のリポジトリを登録
    • upstreamという名前で登録
$git remote add upstream https://github.com/kubernetes/website.git
  • リモートリポジトリの確認
    • upstreamという名前のリポジトリが追加される
    • cloneしたリポジトリはoriginという名前で登録されている
$git remote -v
origin	https://github.com/XXXXXXXX/website.git (fetch)
origin	https://github.com/XXXXXXXX/website.git (push)
upstream	https://github.com/kubernetes/website.git (fetch)
upstream	https://github.com/kubernetes/website.git (push)
  • 更新したいブランチをチェックアウト
$git checkout dev-1.14-ja.1
  • upstreamから最新の情報を取得
    • 差分が表示される
$git fetch upstream
remote: Enumerating objects: 607, done.
remote: Counting objects: 100% (607/607), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 1271 (delta 581), reused 552 (delta 545), pack-reused 664
Receiving objects: 100% (1271/1271), 561.25 KiB | 1.15 MiB/s, done.
Resolving deltas: 100% (888/888), completed with 269 local objects.
From https://github.com/kubernetes/website
 * [new branch]          dev-1.14               -> upstream/dev-1.14
 * [new branch]          dev-1.14-ja.1          -> upstream/dev-1.14-ja.1
 * [new branch]          dev-1.14-ja.2          -> upstream/dev-1.14-ja.2
(省略)
  • マージ元のブランチを指定してマージ
    • ファイル単位で変更が表示される
$git merge upstream/dev-1.14-ja.1
  • 反映させるブランチを指定してプッシュ
$git push origin dev-1.14-ja.1
numerating objects: 331, done.
Counting objects: 100% (331/331), done.
Delta compression using up to 8 threads
Compressing objects: 100% (148/148), done.
Writing objects: 100% (316/316), 140.34 KiB | 28.07 MiB/s, done.
Total 316 (delta 188), reused 288 (delta 163)
remote: Resolving deltas: 100% (188/188), completed with 9 local objects.
To https://github.com/XXXXXXXX/website.git
   0ee892d4a..b502151d1  dev-1.14-ja.1 -> dev-1.14-ja.1
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?