Merge conflict error, when there was no change in mentioned file

I have a site local repo and a remote repo.
Local repo contains the 1-2 month old content of remote repo.

I try to pull the whole content into local repo.

  • Reading a Git repository, without Git
  • git - dual boot ubuntu and windows with separate data partition
  • Visual Studio and libgit2 Git Commit Error In Different Solution
  • git: How do I get the latest version of my code?
  • How to solve hg-fast-export error: “Branch name doesn't conform to GIT standards: refs/heads/master”
  • How to get a branch into a forked repo from the original repo in github
  • git pull origin master
    From ssh://.../site.git
     * branch            master     -> FETCH_HEAD
    CONFLICT (add/add): Merge conflict in admin/process_email.php
    Automatic merge failed; fix conflicts and then commit the result.

    I checked process_email.php using P4Merge, but shows no conflict, furthermore there were no changes at all, no difference.


    I get

    $ git status
    On branch master
    nothing to commit, working directory clean on both repos. 

    Also I tried

    $ git pull -X theirs origin/master master

    But still get the same error.

    I want to merge the remote origin repo with my local repo.
    I want to overwite local repo with remote origin repo content as the remote repo is newer, contains the latest code.

    More than 2000 files are conflicting, while I checked the conflict and they have the same content. I would not want to do manual conflict handling.

    I have
    autocrlf = False
    in the .gitconfig.

    Why do I get conflict error for files, which have exactly the same content?

  • How do I alias commands in git?
  • Git, rewriting history of master branch and associated tags
  • npm install git repository without package.json
  • multiple source code repositories
  • split repo using git filter-branch: how to recover history from renamed/moved files?
  • Why is the reference for a package to be installed from a pull request different for Yarn and original NPM client?
  • 2 Solutions collect form web for “Merge conflict error, when there was no change in mentioned file”

    Finally solved the problem, based on solution used in following thread:

    How to handle/fix git add/add conflicts?

    # moved all files from the local workdir to another directory.
    mv /workdir/* /old_content
    # commit this change
    git commit -m 'Resolve git Add/Add branch merge conflict by deleting conflicted folder and files in myconflictedfolder'
    # do merge from remote
    git pull origin master

    Pull was executed successfully, no conflicts anymore.

    I could now overwrite the old_content directory, if I want, then commit.

    Best regards,

    The messages says you have a add/add conflict, meaning that the file was added both in your branch and in the one you’re merging. This limits Git’s ability to merge because there’s no common ancestor (i.e. you’ll get conflicts for every part of the file different on both sides). Open the file in your text editor and see if you have conflict markers and resolve them.

    Running git status will give you more information about what’s goin on.

    Once you’re satisfied with the content of the file, run git add on it and git commit.

    Git Baby is a git and github fan, let's start git clone.