{"thread":{"id":"26149","subject":"Git Architecture Question","startedAt":"2010-12-28T16:54:30Z","lastAt":"2010-12-29T03:58:52Z","messageCount":3,"participants":["Anuj Gakhar","Manuel Doninger","Maaartin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158674","messageId":"20FFFEFA-5808-4673-B876-C5F76B52D12E@gmail.com","threadId":"26149","inReplyTo":null,"subject":"Git Architecture Question","fromName":"Anuj Gakhar","fromEmail":"anuj.gakhar@gmail.com","sentAt":"2010-12-28T16:54:30Z","receivedAt":"2010-12-28T16:54:30Z","isPatch":false,"sender":{"key":"anuj.gakhar@gmail.com","avatar":null},"body":"Hi all,\n\nI am new to Git and learning this powerful tool these days.\n\nI have a simple question :-\n\nI work on a project that has 3 different environments. dev, staging  \nand production. dev is obviously the local git repo that all dev's  \nwork on. staging is where most of the development takes places on a  \ndaily basis. and production is where least development happens but we  \nstill do it because sometimes we have to fix things quickly directly  \non the production server.\n\nSo how should I set this up ?\n\n2 branches staging and master (default) ?\n\nHow can I make it so that the staging branch gets deployed to a  \ndifferent folder on the server and the master branch gets deployed on  \na different folder ?\n\nOnce a week, we would merge all the staging work into production and  \nmake a release.\n\nAny ideas ?\n\n\nAnuj Gakhar\nwww.anujgakhar.com\nwww.anshconsulting.co.uk\n"},{"id":"158675","messageId":"AANLkTi=Rah9tTUE-vrAqosxqQbPhW8RpOgfEsB_dZJut@mail.gmail.com","threadId":"26149","inReplyTo":"20FFFEFA-5808-4673-B876-C5F76B52D12E@gmail.com","subject":"Re: Git Architecture Question","fromName":"Manuel Doninger","fromEmail":"manuel.doninger@googlemail.com","sentAt":"2010-12-28T17:23:00Z","receivedAt":"2010-12-28T17:23:00Z","isPatch":false,"sender":{"key":"manuel.doninger@googlemail.com","avatar":"https://gravatar.com/avatar/8bfe7a32dcd61ea071cdf4fc757b01896114d6e9bad681ef98595664a18ede98?d=mp&s=160"},"body":"Hi Anuj,\ni'm facing a similar problem at the moment.\nIn my company we want to switch from CVS to Git and Ant to\nMaven/Hudson. We have a similar environment like you, Development,\nTesting and Production, and my plan at the moment is to have a\ndevelopment, testing and master branch. Every of these branches should\nrepresent the appropriate environment. Then I configure Hudson with 3\njobs, every job to build one of these branches and to deploy to a\nseparete folder on our server.\nIf the developers then create a new change in a feature branch, we\nwould merge that feature branch into branch development for our\ninternal tests, then later merge that into testing for our QA\ndepartment if they say they want to test that change, and if they say\nit's ok, merge that change into master to deploy it in production\nenvironment.\nThis workflow is though not in production use, we evaluate this and\nother workflows at the moment, so I don't have any experiences from\ndaily work.\n\nCheers,\nManuel\n"},{"id":"158702","messageId":"loom.20101229T043516-592@post.gmane.org","threadId":"26149","inReplyTo":"20FFFEFA-5808-4673-B876-C5F76B52D12E@gmail.com","subject":"Re: Git Architecture Question","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-12-29T03:58:52Z","receivedAt":"2010-12-29T03:58:52Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"Anuj Gakhar <anuj.gakhar <at> gmail.com> writes:\n\n> \n> Hi all,\n> \n> I am new to Git and learning this powerful tool these days.\n> \n> I have a simple question :-\n> \n> I work on a project that has 3 different environments. dev, staging  \n> and production. dev is obviously the local git repo that all dev's  \n> work on. staging is where most of the development takes places on a  \n> daily basis. and production is where least development happens but we  \n> still do it because sometimes we have to fix things quickly directly  \n> on the production server.\n> \n> So how should I set this up ?\n> \n> 2 branches staging and master (default) ?\n\nI wouldn't use \"master\" for the production branch, I'd call it simply \n\"production\" (there's nothing special about master, except that it's the \ndefault when you start). However, it's quite easy to change it anytime. \nEspecially, each developer may create their own private branches at will. When \nworking on multiple topics concurrently you'll probably create multiple shared \n\"staging\" branches. It's all very fast and very easy to do.\n\n> How can I make it so that the staging branch gets deployed to a  \n> different folder on the server and the master branch gets deployed on  \n> a different folder ?\n\nYou can control both the working tree directory and the git directory using \nenvironment variables (GIT_WORK_TREE and GIT_DIR), so it's easy, e.g.\n\ncd stagingFolder; GIT_DIR=..../.git git checkout staging\n\nYou can use options like --git-dir instead, s. http://www.kernel.org/pub/\nsoftware/scm/git/docs/\n\n> Once a week, we would merge all the staging work into production and  \n> make a release.\n> \n> Any ideas ?\n\nIt may be useful to have a single person responsible for this merging.\n"}]}