Skip to content

Instantly share code, notes, and snippets.

@Sammuel09
Last active March 11, 2020 21:50
Show Gist options
  • Save Sammuel09/44b0478f0f1135e7c94844740786cdd8 to your computer and use it in GitHub Desktop.
Save Sammuel09/44b0478f0f1135e7c94844740786cdd8 to your computer and use it in GitHub Desktop.
This gist explains how to take staging, make some experimental changes and then revert changes
  • git checkout master
  • git pull origin master
  • git checkout staging-test
  • git reset --hard origin/master // this resets the branch to have the latest changes of master
  • git add [my changes]
  • git commit -m "Describe my changes"
  • git push -f origin staging-test

When you are done with staging: I should be within the staging-test branch here Just to be sure

  • git checkout staging-test
  • git reset --hard origin/master // this resets the branch to have the latest changes of master
  • git status //this will show my local branch being behind the remote by 1 commit. this is because staging-test on remote would be 1 commit ahead.
  • git push -f

So basically what happens when you push to staging test?

when I push to the remote branch on staging test, the ci picks up the changes and runs. it would deploy the code to the staging cluster.

Also, when I push to my branch on origin and the create a PR. After code review and the PR is merged, same thing happens. The CI picks up the code, runs test and deploys to the staging cluster as well.

In Brankas, we have a staging cluster and a production cluster. we make a release to production every 4/5 days. the latest commit from master gets merged into the production branch and this gets deployed to the production cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment