Tony
Tony

Reputation: 2482

CONFLICT (content): Merge conflict in

I have a server with a remote and whenever I git pull I get those stupid ====== and HEAD >>>> things in my files causing my server to not work properly. How can I prevent this every time I want to update my server to be the same as my origin/master?

This is what I did:

git pull production master

Then I got this:

CONFLICT (content): Merge conflict in 

When I do a git status I get this:

Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)

    both modified:      photocomp/settings.py
    both modified:      photocomp/wsgi.py

Upvotes: 14

Views: 36800

Answers (2)

Jiemurat
Jiemurat

Reputation: 1629

But it is not stupid thing :) Git marks conflicts (see Merge conflicts in Git) by this way. You must be trying to overwrite changes which haven't been pushed.

<<<<<<<: Indicates the start of the lines that had a merge conflict.

=======: Indicates the break point used for comparison. Breaks up changes that user has committed (above) to changes coming from merge (below) to visually see the differences.

>>>>>>>: Indicates the end of the lines that had a merge conflict.

Resolve a conflict by editing the file to manually merge the parts of the file that git had trouble merging. This may mean discarding either your changes or someone else's or doing a mix of the two. You will also need to delete the <<<<<<<, =======, and >>>>>>> in the file.

Upvotes: 20

Peter van der Does
Peter van der Does

Reputation: 14468

It seems like you modify files locally.

If you want to keep a pristine branch of your remote master, I suggest you pull the remote master in a separate branch, like you seem to do but do any modifications in a separate branch.

Upvotes: 2

Related Questions