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.

古いブランチを最新の状態にしたい

Posted at

ブランチのリサイクル活用

作業ごとにブランチを細かく切るとブランチの量がとんでもないことになるので
すでに作業が終わったブランチを最新のmasterブランチと同じ状態にして
新たにそのブランチで作業したい
簡単だけど備忘録として。

git merge masterでOK

まずカレントブランチの確認

$ git branch

   *master  ⬅️カレントブランチは米印がつく
   branch1
   branch2
   branch3

こんな感じで出る

ブランチ移動

$ git checkout branch1
$ git branch

  master  
  *branch1  ⬅️ブランチが移動する
  branch2
  branch3


$ git merge master

これでbranch1は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?