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

Re: Git Architecture Question

From
MMaaartin <grajcar1@seznam.cz>
Date
Dec 29, 2010, 03:58 UTC
Message-ID
<loom.20101229T043516-592@post.gmane.org>
In-Reply-To
<20FFFEFA-5808-4673-B876-C5F76B52D12E@gmail.com>
Anuj Gakhar <anuj.gakhar <at> gmail.com> writes:
Show 17 quoted lines
> 
> Hi all,
> 
> I am new to Git and learning this powerful tool these days.
> 
> I have a simple question :-
> 
> I work on a project that has 3 different environments. dev, staging  
> and production. dev is obviously the local git repo that all dev's  
> work on. staging is where most of the development takes places on a  
> daily basis. and production is where least development happens but we  
> still do it because sometimes we have to fix things quickly directly  
> on the production server.
> 
> So how should I set this up ?
> 
> 2 branches staging and master (default) ?

I wouldn't use "master" for the production branch, I'd call it simply "production" (there's nothing special about master, except that it's the default when you start). However, it's quite easy to change it anytime. Especially, each developer may create their own private branches at will. When working on multiple topics concurrently you'll probably create multiple shared "staging" branches. It's all very fast and very easy to do.

> How can I make it so that the staging branch gets deployed to a  
> different folder on the server and the master branch gets deployed on  
> a different folder ?

You can control both the working tree directory and the git directory using environment variables (GIT_WORK_TREE and GIT_DIR), so it's easy, e.g.

cd stagingFolder; GIT_DIR=..../.git git checkout staging

You can use options like --git-dir instead, s. http://www.kernel.org/pub/ software/scm/git/docs/

> Once a week, we would merge all the staging work into production and  
> make a release.
> 
> Any ideas ?
It may be useful to have a single person responsible for this merging.
Previous: Manuel Doninger
Message 3 of 3 in “Git Architecture Question”
  1. Anuj GakharDec 28, 2010
  2. Manuel DoningerDec 28, 2010
  3. MaaartinDec 29, 2010

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.