equinox79
9/22/2012 - 3:36 PM

github上でgithubにフォークしたリモートリポジトリを本家リモートリポジトリに追随する

github上でgithubにフォークしたリモートリポジトリを本家リモートリポジトリに追随する

# http://d.hatena.ne.jp/haru-s/20110405/1302006637 に答えがそのままあるが、一応メモ
# github fork 追従 で見つけた

$ git remote
origin

# 本家のリモートリポジトリの短縮名を登録する.
$ git remote add github git://github.com/liquidz/misaki.git

# 本家の更新をローカルで反映させる.
$ git pull --rebase github master
remote: Counting objects: 146, done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 113 (delta 71), reused 88 (delta 46)
Receiving objects: 100% (113/113), 14.46 KiB, done.
Resolving deltas: 100% (71/71), completed with 17 local objects.
From git://github.com/liquidz/misaki
 * branch            master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Fast-forwarded master to a99c960c356b866db59808252391cadce3d3b44b.

# フォークしたリモートリポジトリをpullしてからpushして本家に追随させる.(1)
$ git pull origin master
From https://github.com/ponkore/misaki
 * branch            master     -> FETCH_HEAD
Already up-to-date.

# フォークしたリモートリポジトリをpullしてからpushして本家に追随させる.(2)
$ git push origin master
Username: 
Password: 
Counting objects: 146, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (113/113), 14.46 KiB, done.
Total 113 (delta 71), reused 113 (delta 71)
To https://github.com/ponkore/misaki.git
   a5d9ba1..a99c960  master -> master
$ 

# 完了!!!