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

Re: two branches: keep one difference but merge others forth and back

From
TATor Arntsen <tor@spacetec.no>
Date
Nov 30, 2011, 12:37 UTC
Message-ID
<CABNEGjwJTBEvTcYPS1+DfJGuASGnaQq3wM=zYshvYXdhmnUEUg@mail.gmail.com>
In-Reply-To
<jats5v$r7c$1@dough.gmane.org>
On Sun, Nov 27, 2011 at 18:31, Gelonida N <gelonida@gmail.com> wrote:
Show 15 quoted lines
> Hi,
>
>
> Is this possible.
>
>
> I'd like to have two branches.
>
> If possible I would be able to merge forth and back between both of them.
>
> However I would like, that certain differences will be kept between both
> branches.
>
> Is there any way to tell git to permanently ignoring certain commits
> from merging?

Instead of merging, you could use rebasing. So you have one development branch where you do all the changes, and then another branch where the only commit there is that special difference (as in your /usr/bin/bash example). From then on you only develop/maintain the original branch, and then you rebase the 'special' branch on top of the development branch. Then you get all the updates, plus your special change applied on top each time. Likewise, if you have two variants (say, one /bin/bash, another /usr/bin/bash, and then one with /usr/local/bin/bash) then create two branches and rebase them on top of the third branch (the development branch) every time you wish to deploy new updates.

-Tor
Previous: Carlos Martín Nieto
Message 3 of 3 in “two branches: keep one difference but merge others forth and back”
  1. Gelonida NNov 27, 2011
  2. Carlos Martín NietoNov 28, 2011
  3. Tor ArntsenNov 30, 2011

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.