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

Re: Git Deployment using existing multiple environments

From
Jacob Keller <jacob.keller@gmail.com>
Date
Sep 14, 2015, 08:32 UTC
Message-ID
<CA+P7+xq0ZPOAOONA9x9x_CYt1yf5J4Qcr5oQdQsbtu3iH3ehmw@mail.gmail.com>
In-Reply-To
<BAY180-W55A5095CC7E1322EA80876C25D0@phx.gbl>

On Sun, Sep 13, 2015 at 10:55 PM, Sukhwinder Singh <php_programmer_india@hotmail.com> wrote:

Show 5 quoted lines
> Thank you for the reply. Let's say I do setup three different repositories then how can we move work from one repository to the other. For example, from Test Environment to UAT. If there are any links that you can provide me that I can check, it'll be great.
>
> Regards,
> Sukhwinder Singh
>

Generally speaking there are two ways of moving work from one repository to another. The first is the "pull" where you request data from a remote repository and then merge that data into your own. This is what you're doing when you perform a clone, a fetch, or a pull. It's what everyone does all the time when working with a local copy of a "trusted" remote repository. It can also be done between two "trusted" remotes, if your workflow is more distributed. (ie: more than one "official" source).

The second form of moving work is the "push" where you upload your work into another repository. This is most commonly used when the workflow is "centralized". By that I mean there is a single authoritative repository. Or when you are moving your own work on a local machine into a remotely accessible machine for others to pull from.

As Johannes said above, you really need to determine the work flow and team style you want before you can really understand the best way to setup repositories. For example, if you setup using a distributed chain of command, you can have one person be the "maintainer" of each given trusted repository. Then, maintainers can pull (or equivalent-ly, pull-request) between each other. This is generally how a project would work when using github. One person is the maintainer, then a developer "forks" the project, makes some changes, then requests that the maintainer pull these changes. The maintainer has final say and will perform the final merge in cases of conflict. In addition, maintainer is the one who says "this is ok to go into this repository".

You can also instead opt to use a single centralized repository. Thus, developers would work on code and get it ready to submit, and then simply perform a push. If the push requires a merge git will tell the user to update. There are many tools such as server side hooks in order to enforce various behaviors.

This flow generally doesn't use sole maintainers, as each developer has access to push directly. It may work well for smaller teams or for dedicated teams who don't change developers often.

A lot comes down to how your team is structured. Do you have one person who's job can be to maintain the repository? Do you have several developers who don't want to be the sole owner? Is your team willing to function much more distributed?

In the end, it's generally always a good idea to designate at least one repository as the "authority" so that everyone knows where to look for release tags and other such data.

Myself, I would say that I prefer to use the pull-request model so that code gets more review, as "push" based models tend not to do review. (Exception: Gerrit, but this uses "git push" on the command line to do something very much not like a push)

Regards, Jake

Previous: Sukhwinder SinghNext: Sukhwinder Singh
Message 4 of 7 in “Git Deployment using existing multiple environments”
  1. Sukhwinder SinghSep 12, 2015
  2. Johannes SchindelinSep 12, 2015
  3. Sukhwinder SinghSep 14, 2015
  4. Jacob KellerSep 14, 2015
  5. Sukhwinder SinghSep 15, 2015
  6. Johannes SchindelinSep 15, 2015
  7. Sukhwinder SinghSep 15, 2015

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.