R
R
Ruslan Dasaev2021-09-18 09:11:35
git
Ruslan Dasaev, 2021-09-18 09:11:35

How to delegate individual program components to the branches where they are used?

Good day. Interested in how you are developing individual parts of the program, which will later be used in other branches? Let me explain with an example from my area. I am developing separate components, for example, a modal site window, in a special feature / modal-window branch, and then I want separate branches to automatically pick up the file with this component if it changes. Now what the process looks like: on the branch where I make a separate web application page and where I want to upload and use the component, I do git checkout feature/modal-window src/components/modals/interviewPlanningModal/InterviewPlanningModal.vue , thereby copying the file to current branch. Then I make changes/improvements in a file in a branch with a modal window. I go in turn to the branches, where this component is used and do the above copy operation. So the question is: how to simplify and automate this process? After all, the component can be used on ten branches. Do not do all this 10 times ... I hope that I described the problem more or less clearly.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2021-09-18
@yarkov

It's kind of weird how you came up with the process. It usually looks like this:

  1. Need a modal
  2. We branch from the master, for example, into the feature / modal branch
  3. We develop a modal
  4. Testing
  5. If everything is ok, then we make a merge request
  6. Merge branch into master

There are, of course, long-lived branches, but personally I try to avoid them so that there are no problems with updating and conflicts.

A
Alexander Karabanov, 2021-09-18
@karabanov

You can try Git - submodules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question