3

In our repository, we basically have code for the front end and backend. Up until now, I've juggled with one branch for the backend and another for the front end. However, this leads to me having to jump back and forth between the branches, and rebasing all the time.

What I want to do is to have one branch, do all my development there and when it comes time to do merge, have it done in two steps, one for the backend files and one commit for the front end.

I guess I could cherry-pick, but I liked the regular branch merging. Another way would be to manually create two new branches for the file sets and then merge these two new branches instead. But that's a bit much manual work.

Is there another way?

Edit:

This is a local QlikSense environment, where we have scripts for generating a data mart with functions, we call this the backend. We also have a front end, where there is at least one script for calling the mart with the functions to get the correct parts of the mart, and then the front end application it self with charts etc...

Unless the front end is rebased on the backend, the mart functions will not be available in the front end script.

1 Answers1

2

However, this leads to me having to jump back and forth between the branches, and rebasing all the time

You can use two different worktrees (from the same clone), one for each branch.
That way, you don't have to switch back and forth.
And you can merge each branch in your integration branch without having to cherry-pick.


The alternative would be two different repositories, one for backend, one for frontend, referenced as submodules in a parent repository.
No merge needed there: you update your submodules in the parent repo when you estimate they are ready.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • hm. in option 1, wouldn't I still need to rebase the front end branch on the backend branch in order to use the new backend code? – Mattias Thalén Mar 01 '22 at 08:52
  • @MattiasThalén It depends on how your project is structured. since you have tow local folders (one for each worktree), you could setup your IDE to compile whatever is in those folders, without having to rebase. – VonC Mar 01 '22 at 08:55
  • Ok, unfortunately that won't work here, this is a QlikSense project, so I have scripts for generating a data model with functions defined in the backend scripts. Unless I rebase my front end branch onto this, these functions will not be visible. – Mattias Thalén Mar 01 '22 at 09:27
  • @MattiasThalén OK. The second option is similar to the first: two different folders grouped into one project. I suspect that won't be compatible with your particular project type either? – VonC Mar 01 '22 at 09:28
  • I'm afraid not :/ – Mattias Thalén Mar 01 '22 at 14:00