LoginSignup
13
13

More than 5 years have passed since last update.

devブランチからmasterブランチへ、checkoutせずにmergeする方法

Last updated at Posted at 2014-05-03

いちいちmasterにマージするだけで、checkoutするのは何かと面倒。
ワークコピーとか切り替わるのもやだし、なんとか綺麗にしたい。

git のpushはURLやリモート名だけでなく、ファイルパスも使えるので、

git push . dev:master

みたくしてやればいい。

高速前進がデフォだけど-fつけたら高速前進じゃなくても行ける。

そもそもローカルにmaster持つ必要なければ、

git push origin dev:master

でもいい。この場合ローカルのmasterは永久に更新されないので、show-branchした際にうざくなるから、こまめにmasterにもpullするか、いっそローカルのmaster削除しとくかする。

13
13
2

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