LoginSignup
3
2

More than 5 years have passed since last update.

PR開発について。

Last updated at Posted at 2012-10-25

git push --forceがこわいのってメインのリポジトリがひとつだからと思っている。

ひとつの解決方法として、メインのリポジトリ(upstream)からforkしてoriginをつくることで幾分かはマシになると思う。
それで、originのfeatureブランチからupstreamのdevelopに対してPRを送ることになるし、rebaseしてもoriginに対してgit push --forceするからそこまでこわくない。
コマンドにすると以下。

git push origin feature
# send PR
# no ff merge
git co develop
git fetch origin
git pull origin develop
git co -
git rebase develop
# edit
git add .
git rebase --continue
git push --force origin feature

普段からgit pushだけ叩いている人には合わないだろうけど、人数が多いプロジェクトでPRをつかって開発をするなら、upstreamとoriginっていう方法も考慮したほうがよさそう。

3
2
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
3
2