Switch back and forth from a dev configuration with patch
Between your local dev code and the code you run on the remote (staging or production) server there's always some difference, if anything the database host etc.
My solution is to keep a patch, generated for example with git diff
on a "dev state" working directory after a "production state" commit and then enter and exit the dev state with
patch -p1 < dev.patch
and
patch -p1 -R < dev.patch
Where -R
means reverse, that is, it unapplies the patch.
P.S. you can even set is as a git
hook.
Written by Filippo Valsorda
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Patch
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#