G
G
Grione2020-12-03 11:43:31
git
Grione, 2020-12-03 11:43:31

What is the correct way to work with git pull request?

I am working with repository one. I create a new branch from the master, I do work there, then I do PR of this branch to the master. Next, colleagues should check and freeze this PR in the master, but I need to continue working further with the new code.
I again create a new branch, do the work and do the PR. And in this case, the commits from the first branch go to the second one, which, in my opinion, is not cool.
What is the right thing to do in such cases? When is your work ahead of master?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-12-03
@Casufi

Make a new branch not from the current state, but from the master, then changes from the previous branch will not go into the current one.
If in commands, then before doing git checkout -b feature2 you need to do git checkout master git pull

V
Vasily Bannikov, 2020-12-03
@vabka

Alternatively, you can continue working in the same branch and mark the PR with something like [WIP] or Do not merge, then your colleagues will understand that for now it only needs to be reviewed, but not accepted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question