[kwlug-disc] git: merging some but not all commits
Chris Craig
kwlug.org at ciotog.net
Thu Mar 21 09:57:12 EDT 2019
There's no "right" way to do it, but one way is to have multiple config
files (config-prod.ini, config-devel.ini, for instance), then the actual
config file that's used is a copy of one of these. Another way is to have
config files filled with environment variables, then a .env file that's
used to replace those variables with some build step (or actual deployment
script).
Having said that, storing actual config variables in source control is
generally a bad idea.
On Thu, 21 Mar 2019 at 03:00, Paul Nijjar via kwlug-disc <
kwlug-disc at kwlug.org> wrote:
> I am sure this is a completely standard question, but you know me.
>
> I have a git repo (for a website that I did not create) which has some
> configuration options checked into git. Let's call this branch
> 'master'.
>
> I want to have a development version of the website on my laptop. To
> do this, I have to change some of these configuration options.
> I made a new branch (let's call it 'devel') and checked it out. Then I
> made the changes to my configuration files until I got a local version
> of the website working.
>
> Let's say I check those changes into the 'devel' branch as commit
> 'abcdef' . (This may be a terrible idea.)
>
> I want to do some development. I make some more changes to the
> devel branch and check them in. Hooray!
>
> Now it is time to merge the changes I made from devel to master. If I
> naively git merge then I will get commit abcdef, which merges in
> config options for development, which screws everything up for
> production. Oh no!
>
> I can cherry-pick commits from devel and merge them to master, but
> that seems gross and error-prone. Is there a better way for me to
> merge the changes from devel into master, EXCLUDING a set of commits
> hat I never want merged? I am happy to make additional branches off
> of devel if that helps. I do not think that keeping all the
> configuration differences between master and devel out of git is
> feasible.
>
> What is the right workflow for this situation? How should I be setting
> things up?
>
> - Paul
> --
> http://pnijjar.freeshell.org
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20190321/86439bab/attachment.htm>
More information about the kwlug-disc
mailing list