If I am going to delete a shared branch, is it normal to reinstall?

Say I have two branches - masterand feature. featureis reset and several developers are working. All developers completed their work, completed it and transferred it to a common branch. I make all changes to the local check featureso that it is updated.

I run git merge-base master featureand he gives me 433c4d34e86c3997ffc0ab1b42bb27acce09b2a6.

I want to do this with only one latch, so I run git rebase -i 433c4d34e86c3997ffc0ab1b42bb27acce09b2a6. For the first commit, I use reword, and for the rest I use fixup. The refund is completed and, as expected, it tells me that my branch and origin/featurediverge. I do not click.

I git checkout master, then git pulland finally git rebase master feature. Finally, I git checkout masteragain, then git merge feature.

git status now tells me:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

Is it safe to click on the origin at this moment ? Taking into account that the function branch will be deleted and will never be used again, so we won’t worry that other developers have their own history rewritten from this point of view.

Or did I miss something else here, why is it bad? Maybe the best way to do this?

+4
source share
1 answer

I think there are two points of confusion.

Firstly, it seems like you are worried about the general advice not to reinstall the branch that was clicked, but you are not sure if you understand the reason for this advice.

, , ; , , / , , .

, feature, , feature, feature; , , feature, .

, , master. , feature... , , ? - feature delete.

, , , - , , . . , , master, rebase feature, git. master.

( : , . , - ? feature master, -

git checkout master
git merge --squash feature

, , , , feature.)

+3

Source: https://habr.com/ru/post/1693519/


All Articles