git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git - Pushing to a production website

From
David Aguilar <davvid@gmail.com>
Date
Jan 10, 2009, 11:04 UTC
Message-ID
<402731c90901100304w2ed740e0gdcb41381a41a7f5d@mail.gmail.com>
In-Reply-To
<20090109222344.3539138a@family.dyweni.com>
On Fri, Jan 9, 2009 at 8:23 PM,  <4jxDQ6FQee2H@dyweni.com> wrote:
Show 8 quoted lines
> Hi,
>
> Our company's website is stored in a GIT Repository.
>
> The repository is coded for our test server.  When we push updates to
> the production server, have manually run a script to patch several
> files to make the code work on the production server (i.e. port
> numbers, etc).

The simplest solution is to not track those files at all. Instead of tracking app.conf, mv it to app.conf.sample and track that instead. Likewise, add an entry for app.conf in .gitignore.

When devs create new sandboxes they just
        cp app.conf.sample app.conf
and all is well because app.conf is in .gitignore.

If you literally do 'git mv' in a sandbox and push it out then be careful since pushing that change to production will do exactly what it was told to do (remove the config). it's a small price to pay for simplicity, though, so just remember to keep a backup.

> I'd like to write a script to email me whenever someone changes files
> on the production server without checking those changes back into git
> (i.e. running 'git status | grep "nothing to commit" ...').

Having the config files in .gitignore eliminates a lot of work in your update hooks and it makes writing this script much easier.

The only extra cost comes in having to manage the config files separately from the application, but it's nothing that can't be automated.

Show 9 quoted lines
> However, this approach get confused by the files patched to work
> correctly.
>
> Is there any way to 'save' those patched files so they don't get
> reported by 'git status', yet not mung up the git history every time
> we push out an update?
>
> Thanks!
> --
-- 
    David
Previous: Jacob HelwigNext: Sitaram Chamarty
Message 9 of 10 in “Git - Pushing to a production website”
  1. 4jxdq6fqee2h@dyweni.comJan 10, 2009
  2. Boyd Stephen Smith Jr.Jan 10, 2009
  3. 4jxdq6fqee2h@dyweni.comJan 10, 2009
  4. Boyd Stephen Smith Jr.Jan 10, 2009
  5. 4jxdq6fqee2h@dyweni.comJan 10, 2009
  6. Boyd Stephen Smith Jr.Jan 10, 2009
  7. david@lang.hmJan 10, 2009
  8. Jacob HelwigJan 10, 2009
  9. David AguilarJan 10, 2009
  10. Sitaram ChamartyJan 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.