Do I have every time I do git merge OriginBranch, if the main branch has changed in a Pull Request?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
9 views
Imagine such an example.
git checkout master git pull git checkout-b newBranch // add some code.. git add . git commit git push


Created a Pull Request for the unity of my branches with the main branch.
It took some time my branch have not obedinilis, I need to make some more changes in newBranche.
In parallel with this master branch has changed several times, updated code, etc.

Here the question before how to update a Pull Request, do I need to update the master branch and make marge with my thread ?
approximately
git checkout master git pull git checkout newBranch git merger master


Or just update the code and do a git push without merg'a ?
by | 9 views

1 Answer

0 like 0 dislike

git checkout master
git pull
git checkout newBranch
git rebase master
git push -f

Your pull request will be much easier to take and view if it will be without Marj commits.
Of course, this is only applicable if above this branch he worked exclusively you. If the thread works for someone else, rebels to do.
by

Related questions

110,608 questions
257,186 answers
0 comments
27,920 users