ruby on rails - Heroku: git push staging local-branch:master -


we have local feature branches, github origin branch , heroku staging , production remote branches.

as local features become ready review larger audience we'd push them staging:

$ git push staging local-branch-name:master fetching repository, done. git@heroku.com:app-staging.git  ! [rejected]        local-branch-name -> master (non-fast-forward) error: failed push refs 'git@heroku.com:app-staging.git' hint: updates rejected because pushed branch tip behind remote hint: counterpart. check out branch , integrate remote changes hint: (e.g. 'git pull ...') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details. 

part of me wants --force issue git push -f remote taboo. pull in changes "hint" says given branches push staging short lived , may have little each other seems unnecessary , confusing.

what proper procedure sharing staging server on heroku?

you're using git on staging server deployment mechanism, not version control. have real remote on github, don't see harm in force pushing staging server long never pull changes it.

force pushing typically bad idea 2 reasons.

  1. you can lose commits. if force push remote ahead of branch, commits ahead of yours lost.

  2. you can mangle other developers' repositories. if force push remote branch developer has pulled, branch out of sync remote , difficult recover.

however, in case pushing repository. never lose commits because upstream never ahead of particular branch. also, never pulled other developers. reasons, ok force push in case.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -