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

[git]本家リポジトリを取り込んで最新のリポジトリをrebaseする方法

Last updated at Posted at 2020-12-13

はじめに

最新の本家リポジトリを自分自身の環境に取り込んで、rebaseする方法を備忘録としてまとめる

前提として、本家リポジトリをforkして自分の開発環境に用意してください。

方法

ターミナルで下記のコマンドを実行する

git branch -a

⇩のような感じの表示がされるはず

master
remotes/origin/master

次にupstreamを登録する

git remote add upstream git://github.com/リポジトリURL

git branch -a を再度実行し、upstreamが表示されていることを確認する

⇩的な感じで表示されるはず

master
remotes/origin/master
remotes/upstream/master

表示されない場合は下記を実行

git fetch upstream

これで登録完了

本家リポジトリの変更を取り込む場合

git fetch upstream

コンフリクトが起きている場合はターミナルに表示されている手順に沿って修正する

git rebase upstream/master

参考

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?