1
1

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.

masterブランチを別のブランチに書き換え方法

Last updated at Posted at 2017-07-05

作ったブランチ(sub-branch)を用いて、masterブランチを完全に書き換える。


$ git checkout sub-branch
$ git merge -s ours master
$ git checkout master
$ git merge sub-branch
$ git push origin master

-s ours = --strategy=ours

Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. 
If there is no -s option, a built-in list of strategies is used instead (git merge-recursive when merging a single head, git merge-octopus otherwise).

以上です。

参照
git-merge

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?