Git rebase develop industry

Sorry, just another “relocate” question, but I'm confused. From time to time, I push my commits to the development branch to the remote (source). Now one thing that has always been mentioned with rebase: "never reinstall if you pushed your changes."
Does this mean that I could never reinstall my development branch, just merge it?

Work on a feature branch is clear, if I didn't push it, I could reinstall instead of merging. My question only points to the development branch.

+4
source share
4 answers

Read the "Dangers of Rebooting" in the book "Pro Git - it provides a good explanation with pictures. The git-rebase manual page also contains a section on" Restoring from an upward permutation "), which makes you appear on everyone your rebase might affect .; -) Nice ASCII-art is also included.

And no, “never reinstall what was clicked on a public repo” should not be taken as a dogma: sometimes this is a valid approach if such a redistribution is clearly formulated for other users of your public repository. For example, see what the current supporting Git says about its "pu" branch (this note is somewhat outdated and newer versions of this text do not mention the failure directly, so I decided to link this old copy).

+3
source

You can reinstall (and force push the next one) if no one has cloned / updated their own local repo using a remote repo.
If other people pulled out of your remote repo and you force-click your child branch, you publish a new story, forcing them to perform a more complex reset operation (they should reset their own local branch to the new branch history console, and then repeat their own commits) .
For a public remote repo, forced push can lead to problems;) .

+3
source

It doesn't matter what kind of branch you have (after all, this is just a concept, for git, a branch is a branch). After you have made any changes, do not redirect, otherwise the commit hash will change.

+1
source

You do not have to reinstall draggable commits. However, it is great for reinstalling ( -i ) that have not been pressed.

0
source

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


All Articles