threads / discuss / 24386

Merging branches

Subject: Merging branches

## tl;dr

3 messages between Jul 13, 2010 and Jul 14, 2010.

replies: 2people: 3as markdown or json

jhapk· Jul 13, 2010, 21:28 UTC · lore
http://git.661346.n2.nabble.com/file/n5289861/git.jpg git.jpg 
Hi,

I have a git history which looks something like as in the figure above. I want to merge Branch A in Branch B. However, the commits a1, a2 and a3 are ugly and so I don't want those commits in my Branch B log. Is there anyway that I can only pull the final form of Branch A without pulling the whole history of Branch A?

Thanks
-- 
View this message in context: http://git.661346.n2.nabble.com/Merging-branches-tp5289861p5289861.html
Sent from the git mailing list archive at Nabble.com.
Ævar Arnfjörð Bjarmason· Jul 13, 2010, 22:05 UTC · re: jhapk · lore

Re: Merging branches

On Tue, Jul 13, 2010 at 21:28, jhapk <pradeep.kumar.jha@gmail.com> wrote:
Show 5 quoted lines
> I have a git history which looks something like as in the figure above. I
> want to merge Branch A in Branch B. However, the commits a1, a2 and a3 are
> ugly and so I don't want those commits in my Branch B log. Is there anyway
> that I can only pull the final form of Branch A without pulling the whole
> history of Branch A?
Yes, you use rebase to squash or drop those commits, and then merge the branch.
Avery Pennarun· Jul 14, 2010, 05:24 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: Merging branches

On Tue, Jul 13, 2010 at 6:05 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 8 quoted lines
> On Tue, Jul 13, 2010 at 21:28, jhapk <pradeep.kumar.jha@gmail.com> wrote:
>> I have a git history which looks something like as in the figure above. I
>> want to merge Branch A in Branch B. However, the commits a1, a2 and a3 are
>> ugly and so I don't want those commits in my Branch B log. Is there anyway
>> that I can only pull the final form of Branch A without pulling the whole
>> history of Branch A?
>
> Yes, you use rebase to squash or drop those commits, and then merge the branch.
Or just "git merge --squash".
Have fun,
Avery

← back to recent threads