Results 1 to 3 of 3

Thread: [GITHUB] - Merging code from staging to production

  1. #1
    Join Date
    Dec 2007
    Thanked 1 Time in 1 Post

    Question [GITHUB] - Merging code from staging to production


    I am facing a problem lately regarding merging our code from staging to production so I thought to seek some help from the experts

    We are using GITHUB for our projects. We have two different environment i.e. "staging" where we do our development and perform test etc, and "production" where we have our application for our users. Both of these are on GITHUB where "production" is the "master" and "staging" is in a "branch" under it.

    Now, all our developers work on diff modules and they add the code into "staging", all is fine till here, the problem occurs when they have to merge the code of "staging" to "production", currently they manually compare the two files (production v/s staging) and merge the changes which takes a hell lot of time. The reason they cannot directly move the entire file is because there are many devs working on the same file on diff functionalities and all of them may not be ready to go to production.

    So I was wondering if there is any option on GITHUB that can make our life simple OR is there any other approach we can follow that will minimize our efforts?

    Any help will be appreciated.


  2. #2
    Join Date
    Jul 2008
    Derbyshire, UK
    Thanked 599 Times in 575 Posts
    Blog Entries


    Have you contacted GitHub directly with your queries?
    They'd be in a better position to answer your questions.

    You might also be able to find the answer in their help section:
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Apr 2008
    Thanked 516 Times in 502 Posts
    Blog Entries


    It's more of a workflow issue than a git issue. I don't know, of course, but it sounds like you don't have a *single* person who is responsible for merging changes into the master branch - instead, letting anyone push changes on their own, without oversight or review.

    In addition, if you have multiple developers, they should each have their own forks (and/or each feature should have its own fork), which is merged back into the development branch when they're done making their changes. This way, each dev only has to worry about the code they checked out; you also don't have to worry about "unfinished" code (it simply sits in the dev fork; it isn't pulled into staging until the dev decides it's ready).

    Your resulting workflow might look something like this: forks from the "staging" branch to work on a new feature. finishes code, writes and executes tests.
    If it's all good, he makes a pull request* to "staging." (or whoever you make responsible) reviews new code, runs tests, makes sure it doesn't conflict with anything else, etc.
    If it's all good, merges it back into "staging."
    Another advantage here is that "staging" is (ideally) always in working condition: in theory, it can push to your master (production) branch at any time. But you also have a chance to run testing on the entire project and discover problems before you make them public.

    ...manager (or whoever you make responsible) pulls "staging" code into "production" when it's ready.

    *I'm advocating the fork&pull model, here, not the shared repo.
    shared is more like what you have now, and is where your problems are coming from.

Similar Threads

  1. Merging php code into js
    By Burgin in forum JavaScript
    Replies: 9
    Last Post: 05-25-2012, 01:47 PM
  2. Replies: 2
    Last Post: 02-20-2012, 07:26 AM
  3. Ultimate Fade-In works locally, but not on production server
    By dianagard in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-01-2011, 06:10 PM
  4. Need help merging 2 bits of code..
    By VsUK in forum JavaScript
    Replies: 0
    Last Post: 05-08-2011, 05:10 PM
  5. Merging 2 scripts
    By jr_yeo in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 06-11-2006, 10:27 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts