0
0

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 3 years have passed since last update.

前にForkしてきたリポジトリが新しくなったので差分として自分のリポジトリに入れたい

0
Posted at

やりたいこと

  • 前にForkしたリポジトリが更新されているので、自分のリモートリポジトリに同じ更新内容を入れたい。
  • 更新内容(差分)を手元の枝に入れて、1変更として自分のリモートリポジトリにpushしたい。
  • そしてmergeさせて差分を入れたい

これ見てやった

用語理解

やったコマンド

  1. Fork元のリポジトリURLに"upstream"って名前つけてあげる

    $ git remote add upstream [http://最新の情報が入ってる他の人のリポジトリ(Fork元)] 
    
  2. "upstream"ちゃんと設定できたか確認(設定されてないと4行出てこない)

    $ git remote -v
    > origin ..
    > origin ..
    > upstream ..
    > upstream ..
    
  3. "upstream"の最新情報を自分のリモート追跡ブランチに引き込む
    (多分さっきupstream作ったばっかりの人は、これやらなくても最新になってる気がする)

    $ git fetch upstream
    
  4. 自分の手元の、差分を入れたい枝に移動

    $ cd なんちゃら/なんちゃら/入れたいbranch名
    
  5. 枝に差分を入れる

    $ git merge upstream/master
    
  6. 自分のリポジトリにcommitしてpush

  7. おしまい

自分なり解釈

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?