Pergunta

I'm using something like this on my production server, setup as a post-receive hook on github, and it's basically set to pull changes on a specific branch whenever it gets a properly formatted request from github.

Now, let's say someone pushed bad code to master, which automatically pulled on production and broke everything. What is the best way to revert the changes, without having to ssh to the production server and manually checkout old code? Ideally it would be as simple as doing another push.

Thanks!

Foi útil?

Solução

If that bad code is the result of one or several commits, use git revert to cancel them locally.
That will create a new commit cancelling the bad code, and you can push that commit.

Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them

Pushing that revert commit to GitHub will trigger the post-receive hook and pull that new change into production.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top