mazeltov7のweb断片

備忘録的なテキトーなことを書きます。(技術記事はQiitaに移行しました http://qiita.com/mazeltov7 )

今のbranchをmasterにしちゃう

ある部分のバグを直してたら、別のところでバグが出て、なんでやぁーーーってなってたので、
ちょっと前に戻って、その原因を突き止めるために、ブランチを作って、git resetで探ってみるということをしてみた。

で、原因の場所を特定して、bugfixして、ちょっと機能追加などしてると、こっちのブランチの方がイケてる感じになったので、こっちをむしろmasterにしてーーーってなったので、その方法をやってみたという話。

この辺を参考に。
Change the current branch to master in git(これで解決)
7. rebaseでマージする

$ git checkout better_branch
$ git merge --strategy=ours master    # keep the content of this branch, but record a merge
$ git checkout master
$ git merge better_branch             # fast-forward master up to the merge

で完成!