git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Noob question on using branches
@ 2008-05-06 15:47 Barry Roberts
  2008-05-06 16:00 ` Matthieu Moy
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Roberts @ 2008-05-06 15:47 UTC (permalink / raw)
  To: git

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

right?

It looks like "git pull --squash . production" will do what I want.  Is 
that correct, or is there a better way?  git cherry-pick seems 
cumbersome when I already know I want everything in the branch (unless 
there's a way to tell cherry-pick to get the whole branch and I've 
missed that).

Thanks,
Barry Roberts

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Noob question on using branches
  2008-05-06 15:47 Noob question on using branches Barry Roberts
@ 2008-05-06 16:00 ` Matthieu Moy
  2008-05-06 16:15   ` Barry Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Moy @ 2008-05-06 16:00 UTC (permalink / raw)
  To: Barry Roberts; +Cc: git

Barry Roberts <blr@robertsr.us> writes:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Noob question on using branches
  2008-05-06 16:00 ` Matthieu Moy
@ 2008-05-06 16:15   ` Barry Roberts
  0 siblings, 0 replies; 3+ messages in thread
From: Barry Roberts @ 2008-05-06 16:15 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Matthieu Moy wrote:
> Barry Roberts <blr@robertsr.us> writes:
>
>   
>> 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.
>   
So it does.  That does appear to be exactly what I need.
> 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).
>
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-06 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 15:47 Noob question on using branches Barry Roberts
2008-05-06 16:00 ` Matthieu Moy
2008-05-06 16:15   ` Barry Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).