If a colleague and the server changed the same lines, git does not choose for you — it puts both versions into the file.
A merge or git stash pop carries edits over line by line. When both sides changed the same line, you get a conflict (in the Wiki): git says CONFLICT (content): Merge conflict in <file>, and git status says both modified. In the file, markers appear where the line was:
A conflict is resolved by hand: keep what you need — one version or a line built from both — and delete the three marker lines. With markers in it the config fails sudo nginx -t. Then git add <file> tells git the conflict is resolved. After a conflict stash pop does not delete the set-aside edit — “The stash entry is kept in case you need it again”; once the edit is in the file, git stash drop removes the entry.
Update the server when the edits collide
/etc/nginx/conf.d has a local edit again, and the repository has a new commit from a colleague, and each added a site name to the server_name line. Update the working copy to the repository's version so that the config keeps both new names, passes nginx -t, and no set-aside edits remain.
Goals · 0 of 2
- Update the working copy, leaving no set-aside edits not done yet
- Keep both names in the config without conflict markers not done yet