R
R
Romi2021-04-22 10:12:44
git
Romi, 2021-04-22 10:12:44

How to work with branches (branch) one by one (see description)?

For example I do git pull on master

then create branch-1 switch to it and work for a while

then switch to master do git pull get some changes in master and create a new branch branch-2

switch to branch-2 , which is I do something with it there,

then I switch to master, I do git pull - there again I get some changes to the master

and I have a question:

what if I now switch to branch-1 - will it be in the form in which I have it left? without new changes introduced after it in master?

but how then to be? and if, for example, in this branch-1 I just need those new features that appeared in master?

well, i.e. understand the question, right? such a standard situation that here I am writing some modules for the application, and maybe someone else writes them there, and then they merge them into master, and it would be nice to somehow get the current version of the application in branch-1 as a whole.

How is this usually resolved?

thank.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2021-04-22
@romicohen

and if I now switch to branch-1 - will it be in the form in which I left it? without new changes introduced after it in master?

Right.
but how then to be? and if, for example, in this branch-1 I just need those new features that appeared in master?

Either merge master into branch-1, or immediately shoot from master to branch-1. You can also do a rebase or copy commits via cherry pick
well, i.e. understand the question, right?

Understand

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question