How to use git feature branches with live updates and merge back to master?
Posted
by karlthorwald
on Stack Overflow
See other posts from Stack Overflow
or by karlthorwald
Published on 2010-04-27T13:14:38Z
Indexed on
2010/04/27
13:33 UTC
Read the original article
Hit count: 229
git
|production-environment
I have a production website where master is checked out and a development webiste where I develop in feature branches.
When a feature is merged into master I do this on the development site:
(currently on the new-feature branch)
$ git commit -m"new feature finished"
$ git push
$ git checkout master
$ git merge new-feature
$ git push
And on the production site:
(currently on master branch)
$git pull
This works for me. But sometimes the client calls and needs a small change on the website quickly. I can do this on production on master and push master and this works fine.
But when I use a feature branch for the small change I get a gap:
(On production on branch master)
$ git branch quick-feature
$ git checkout quick-feature
$ git push origin quick-feature
$ edit files...
$ git add .
$ git commit -m"quick changes"
$ git push # until this point the changes are live
$ git checkout master #now the changes are not live anymore GAP
$ git merge quick-feature # now the changes are live again
$ git push
I hope I could make clear the intention of this workflow. Can you recommend something better?
© Stack Overflow or respective owner