Home computickets What is the difference between Merge from Commit?

What is the difference between Merge from Commit?




What is the difference between Merge from Commit?
When compete – fill, say, in the main branch your changes. When Meriz – combine your copy with changes in the main branch.

When you need to post a project in production, switched on trunk, let’s merge, and then also compects, why is the second action?

Answer 1, Authority 100%

If Merge would be equivalent to Merge + Commit , the user would lose the ability to perform the following actions:

  • Whole Review Changes in Feature Branch , which appear after Merge --reintegrate .

  • Solve Conflicts and Tree Conflict'a , which arose as a result of the operation Merge .

Answer 2, Authority 100%

The fact is that Commit is not just a fill of changes. The essence of this operation is that the changes made locally are transformed into changes that can be successfully added to the repository and are fixed in it as another revision. At the same time, local changes are always expressed in the form of differences relative to the last audit, which is known locally (i.e. revisions, which was during the last update), and only such changes that are expressed in the form of differences relative to the last revision can be added to the repository The repository itself.

In the simplest case, when nothing from the part was added to the repository, the change conversion is reduced to not to do anything, because changes are already already expressed in the form of differences relative to the last revision in the repository. Therefore, the COMMIT operation becomes trivial and looks like a simple fill of changes. In the case when, from the moment of the last Update, something new appeared in the repository, an attempt to make the trivial commit fails and has to go through the entire procedure completely, i.e. At first, adapt their local changes to those other changes that have already been fixed in someone else in the repository, and only then pour them and fix them.

When we fill the changes in the repository made in the working copy, the need to do the Commit at the very end is obvious. After all, there are no other local changes in the repository, since the previous attempt to make the trivial Commit failed. This necessity is not so obvious when we combine one branch on the other right in the repository with Merge. The point here is what. In fact, the Commit operation also plays a confirmation role. Pouring in the repository of new changes in both the trivial case and after adaptation is always performed after the user saw the final version, so its confirmation required for fixing the next revision, as if implying and is given to the same Commit. But about the association of branches in the repository cannot be said. The result of combining branches is usually different from what was in the last revisions as one branch and the other. It is a completely new revision. And even in the case when the participation of the user in the combination of branches is not required, it still needs to be confirmed after the final version of the new revision is obtained. It is for this that needs Commit after Merge. If the union passed on the machine, then Commit plays only the role of confirmation that is necessary for fixing any revision in the repository.

Answer 3, Authority 100%

  • commit – means lay out your version in the repository
  • update – means to pump out the version from the repository (update your)
  • merge – means making changes in your version compared
    With a version from the repository. Usually, the user is given the opportunity
    viewing changes (line) To determine what changes from
    Repo can be applied to its version (solving conflicts).
  • Diff – comparison of 2 versions. It often makes sense to make merge
    Or to view changes made by another member of the
  • team

  • Checkout – Obtaining entire source sources from repo. As a rule is done
    At the very beginning of work

Typical work pattern: checkout → WORK → COMMIT → Break → Update (possibly with Merge) → We work → Commit, etc.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions