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.

リモートブランチを、異なる名前のローカルブランチにpull(merge)する方法

0
Posted at

どうにもこうにも上手くpull出来ていなかったのがようやく解決した(?)と思われるのでまとめていく。

ブランチの関係と問題点

自分は、複数のコードを同時に触ることが多々あるため、下の図のような関係でブランチを切っている。

図1.png
※リモートのA…B…C…には、コード名やパラメータ名を入れている。

developmentで書き換えたコードを、リモートでは異なるブランチにpushし、それをmasterにmergeするというやり方をしている(nclは特に)

異なる端末で作業をした際、上手くpull出来ないことが多々あって困っていた…
特に、普段作業している研究室の端末の場合は、ほとんどgit pullで解決していたのだが、使用のmac book airでは上手くpull出来ない。

対処法

上の図で、リモートのdevelop-Cをローカルのdevelopmentに反映させる場合

terminal
$ git checkout development
$ git merge remotes/origin/develop-C

とすれば上手くいった。が、mergeしてしまっているため、logを見返すことが必要になってくると、あまりよろしくないのかも。
というのと、複数のブランチで競合してる場合も…あまり深く考えずにやっているが、本当はもう少し考えてブランチを切って作業をする必要があるかも。

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?