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

Re: Apply commits from one branch to another branch (tree structure is different)

From
Brandon McCaig <bamccaig@gmail.com>
Date
Mar 18, 2014, 17:18 UTC
Message-ID
<CANUGeEb6u82=GbnoFiXbWjZmdBtQ_0ObixLcPcKLF-Z0ABgXOQ@mail.gmail.com>
In-Reply-To
<CAD6G_RTZaaYBP0MrmRYhce2v+A+WwvY=97Do3LoWW-SYzkHM2g@mail.gmail.com>
Jagan:
On Fri, Mar 14, 2014 at 12:39 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> Hi,
Hello,
Show 22 quoted lines
> I have two branch in one repo that I need to maintain for 2 different
> deliveries.
> Say branch1 and branch2 in test.git repo.
>
> test.git
> - branch1
>      foo_v1/text.txt
>      foo_v2/text.txt
> - branch2
>      foo/text.txt
>
> branch1 is developers branch all source looks version'ed manner and
> branch2 is superset for branch1, example foo_v1 and foo_v2 are the directories
> in branch1 where developer will update the latest one here foo_v2 and branch2
> foo is same as the latest one of branch1 for an instance.
>
> Suppose developer send 10 patches on branch1 where are changes in terms
> of <dir>_<version>/ then I need to apply on my local repo branch1, till now
> is fine then I need to apply same 10 patches on to my branch2 where source
> tree <dir> which is quite question here how can I do.
>
> Request for any help! let me know for any questions.

This just sounds like a painful workflow to me. I would suggest not doing this at all, but rather using tags to mark specific releases, and using individual branches for continued development (e.g., stable or v1.x or whatever is most appropriate). You can have unstable or master or dev or whatever for developers to work on freely without breaking releases (albeit, there are many different workflows you can use to manage the transition from unstable to stable code).

I would avoid using subtrees (subdirectories) within a Git repository to represent different releases of the code. Git already tracks versions. That is redundant and messy. It's really an outdated way of thinking about version control.

/my 2 cents
Regards,
-- 
Brandon McCaig <bamccaig@gmail.com> <bamccaig@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bamccaig.com/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'
Previous: Andrew Wong
Message 9 of 9 in “Apply commits from one branch to another branch (tree structure is different)”
  1. Jagan TekiMar 14, 2014
  2. Jagan TekiMar 14, 2014
  3. Brandon McCaigMar 18, 2014
  4. Andrew WongMar 14, 2014
  5. Jagan TekiMar 14, 2014
  6. Andrew WongMar 14, 2014
  7. Jagan TekiMar 14, 2014
  8. Andrew WongMar 14, 2014
  9. Brandon McCaigMar 18, 2014

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.