From: Konrád Lőrinczi 
  To: Philip Oakley 
  Cc: git-users@googlegroups.com 
  Sent: Saturday, May 16, 2015 9:24 PM
  Subject: Re: [git-users] Live & local development server


  Is there some specific Git or Linux tool for such task?
  I mean is there some use case for what other developers are using? 

  What hooks should I use forth & back? 


  Thanks, 
  Konrad 


try http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes and 
http://stackoverflow.com/questions/22909620/git-smudge-clean-filter-between-branches
 for some guidance. 

The first gives a nice overview, while the SO question includes a few examples.

Philip

  2015.05.16. 22:03 ezt írta ("Philip Oakley" <philipoak...@iee.org>):

      From: Konrád Lőrinczi 
      I have a live server & a local development server, both Linux. 


      I develop and have my local repo under Windows.


      Both Linux servers are connected to my local repo as remote repos.


      My problem is, that local server has some localized content, like 
config.php.


      Example difference:
      Live server:
      domain="site.com"
      Local dev server:
      domain="site.lc"


      1)
      One solution would be to add config.php 
      to .gitignore, but this risks that if I add another config variable to 
the server, it will be not merged to the local dev server.


      Is there a possibility to add regular expressions to the .gitignore file?


      2)
      Use a hook script to localize the server content while merge compare is 
done. 
      Is that possible to do something similar? 
      How others do this? 




      Thanks, 
      Konrad 

      -- 
    IIRC one suggestion is to have different smudge & clean filters for such 
files. This means when you checkout locally you would pass those config files 
through a filter which replaces `domain="site.com"`  with `domain="site.lc"`.

    And vice versa on the way back.

    So your commits are always production 'ready' (well at least suitable / 
config'd for them).

    Do make sure any filters are idempotent (can be applied multiple times 
without changing the result beyond the first desired change).

    Philip


  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to