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

Re: Noob question on using branches

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
May 6, 2008, 16:00 UTC
Message-ID
<vpqiqxrctio.fsf@bauges.imag.fr>
In-Reply-To
<48207DA4.80502@robertsr.us>
Barry Roberts <blr@robertsr.us> writes:
Show 9 quoted lines
> I have a branch in my git repository that is a "released" branch.  It
> only gets defect fixes as they are needed to patch our production
> servers.
>
> I want to get all those defect fixes back into the master, but I don't
> want changes from the master getting into the production branch, so I
> don't think I want to do:
> git checkout master
> git merge production
Why wouldn't you?

The "git merge production" will take all the changes in production and put them in the current branch. You'll get a new revision that contains both the stuff in master and the one in production. But what's important is that the reference "master" is updated to that new revision, but "production" stays where it is.

Just try it, then run "gitk --all" to see if the result is what you wanted. If not, "git reset --hard HEAD^" will move back "master" to where it used to be (read about "git reset" before you run it).

-- 
Matthieu
Previous: Barry RobertsNext: Barry Roberts
Message 2 of 3 in “Noob question on using branches”
  1. Barry RobertsMay 6, 2008
  2. Matthieu MoyMay 6, 2008
  3. Barry RobertsMay 6, 2008

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.