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

RE: Beginner's question on how to use git for multiple parallel versions

From
Bill Lear <rael@zopyra.com>
Date
Jan 4, 2010, 15:44 UTC
Message-ID
<19266.3277.221519.791489@blake.zopyra.com>
In-Reply-To
<22D57EF90F8E4A2799F739FC14F8BA63@Duthler.local>
On Monday, January 4, 2010 at 14:35:25 (+0100) Christian C. Schouten writes:
Show 11 quoted lines
>Dear Bill,
>
>Thanks for your prompt reply. It may very well be exactly what I need, but
>I'm afraid that I don't understand the syntax just yet (am still in the
>phase orienting on what version management is and how it should be set up).
>
>Could you please add to your answer whether I am using branches or another
>git technique (terminology?) and whether these are instructions that I can
>use to commit a change once the system has already been set up or if these
>actually are the instructions for defining the multiplicity of my project
>versions?

In my example, I used branches, but did not show how to set them up. Here is the complete example, complete with repository and branch creation; you would start your project here:

# Set up repo and add first file to main branch: % mkdir my_project % cd my_project % git init % echo "main line process stuff" > process.bpel % git add process.bpel % echo "<non-version-specific table info>" > table.xml % git add table.xml % git commit -a -m "First commit on master branch"

# Create branch A and branch B: % git branch A % git branch B

# Modify file on branch A: % git checkout A % echo "<table A>" > table.xml % git commit -a -m "Modify table on Branch A"

# Modify file on branch B: % git checkout B % echo "<table B>" > table.xml % git commit -a -m "Modify table on Branch B"

# Now go back to master and make some changes on common file: % git checkout master % cat process.bpel main line process stuff % echo "add more process stuff" >> process.bpel % git commit -a -m "fix process stuff on master"

# Now go to branch A and pull in the common file: % git checkout A % git merge master % cat process.bpel main line process stuff add more process stuff

# Now go to branch B and pull in the common file: % git checkout B % git merge master % cat process.bpel main line process stuff add more process stuff

That should be just about all you need.
Bill
Previous: Christian C. SchoutenNext: Dmitry Potapov
Message 4 of 5 in “Beginner's question on how to use git for multiple parallel versions”
  1. Christian C. SchoutenJan 4, 2010
  2. Bill LearJan 4, 2010
  3. Christian C. SchoutenJan 4, 2010
  4. Bill LearJan 4, 2010
  5. Dmitry PotapovJan 4, 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.