Fei Xue
Fei Xue

Reputation: 2045

What does this git log mean?

this is the recent log of the git.

commit 608991c
Merge: 5c0c062 1fe65f9
Author: foo
Date:   Mon Jul 2 

    Merge branch 'mybranch' of xxx.xxx.xxx.xxx:/myproject into mybranch

    Conflicts:
        bar.c

Does this log mean the user foo does a merge operation?

Upvotes: 2

Views: 1096

Answers (1)

VonC
VonC

Reputation: 1329822

As described in "Merging With a Conflict: Conflicts And Resolutions", this is the automatic log message generated after the resolution of a merge with conflicts.

You can see that message built in git source file builtin/merge.c, in the suggest_conflicts() function

static int suggest_conflicts(int renormalizing)
{
    const char *filename;
    FILE *fp;
    int pos;

    filename = git_path("MERGE_MSG");
    fp = fopen(filename, "a");
    if (!fp)
        die_errno(_("Could not open '%s' for writing"), filename);
    fprintf(fp, "\nConflicts:\n");

From a user point of view:

Resolve the conflict

After we have resolved the conflict (by changing the README file the way we want for this git merge), we have to tell git that the conflict is resolved by adding the conflicted file to the index.

In this case, we need to add README to the git index.
git status will then no longer complain about the README file having a conflict:

$ git add README
$ git status
# On branch master
# Changes to be committed:
#
#   modified:   README
#   new file:   plan
#

We're ready to commit the merge:

$ git commit
[master 368a14a] Merge branch 'test'

The git log command shows the resolved conflict:

$ git log
commit 368a14a034eda95ee401bb56b3bb8df04b84ab0c
Merge: 3330113 c406564
Author: Tim Flagg 
Date:   Fri Mar 25 13:26:10 2011 -0700

    Merge branch 'test'

    Conflicts:
        README

gitg --all shows the merge:

merge in logs

Upvotes: 2

Related Questions