merge-conflict-resolution

Why does git show a conflict between two apparently identical added files?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 20:50:03
问题 I have a project that was started in TFS, then moved to Git. Unfortunately, the guy who moved it to Git just checked in the current files instead of using git-tfs. I'm trying to rebase his new commits in Git on top of the commits I pulled from TFS using git-tfs. To do this, I'm simply rebasing his commits on top of the git-tfs commits. (I realize this will mess up remote Git branches, but we're a small team and it'll be OK. I've also tried cherry-picking instead but I hit the same problem.)

Git is not showing any conflicts, and is overwriting my local copy

久未见 提交于 2019-12-06 12:18:59
My routine on git has always been very simple: git add -A git commit -m 'the changes I made' git pull # resolve conflicts git push However, for some unknown reasons, despite lots of conflicts with the origin, after pulling, I don't get any conflicts and without my permission it force updates my local copy. Something along these lines: '2 files changed, 2 insertions(+), 6 deletions(-)'. But in my case, conflicts shouldn't be resolved from simple merge and should require manual conflict resolution from my side. Why is git not letting me to do the manual conflict resolution? Thanks in advance!

git status and git diff empty after failed git am

拥有回忆 提交于 2019-12-06 06:03:55
问题 I'm developing on a different machine than I usually do, and it seems that git is behaving differently than I remember. When I checkout a new branch git checkout -b <new branch name> , and try to apply a patch git am </path/to/file.patch> , the patch fails to apply: </path/to/file.patch> Applying: <commit msg> error: patch failed: <filename>:<line no> error: <filename>: patch does not apply Patch failed at <commit msg> The copy of the patch that failed is found in: .git/rebase-apply/patch

Git Merge - Binary File Conflict Resolution

北战南征 提交于 2019-12-06 03:04:26
How do I resolve a binary file conflict resolution during a merge operation in git? Here's what I've done so far: git checkout master git fetch origin git merge working_branch ... [Conflicts] ... git status ... Unmerged paths: both modified: Path/file.dll ... I want to keep the version in the working_branch and discard the version in the master . How do I do this? Figured it out earlier today: git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge conflict by checking out file from working_branch and adding it to the master" 来源: https://stackoverflow.com

Can I merge only non-conflicting changes in Git?

守給你的承諾、 提交于 2019-12-05 23:31:32
How can I simply (e.g. in one command?) merge in Git, keeping the state of conflicting files as in the current branch and without specifying each file individually as in theirs/ours options? git checkout master git merge stable --some-option-to-keep-files-? The merge strategy has an "ours" option which is what you want git merge -s recursive -X ours remote/branch As the manpage stresses out, this is NOT git merge -s ours. 来源: https://stackoverflow.com/questions/12572530/can-i-merge-only-non-conflicting-changes-in-git

git merge conflict due to moved files

半城伤御伤魂 提交于 2019-12-05 21:57:01
I have not done so much with git so far. Now, I have the following problem. While I did some local modifications and commits, my colleague restructured files and folders within a new branch. Then, I added a remote tracking branch (reflecting his changes) and tried to merge my modifications into it. Of course it fails as the files moved to another location. How can I go onwards? A 'git status' shows me this: # On branch develop # You have unmerged paths. # (fix conflicts and run "git commit") # # Unmerged paths: # (use "git add/rm <file>..." as appropriate to mark resolution) # # deleted by us:

Feature backporting in Git / Subversion

邮差的信 提交于 2019-12-05 20:41:53
问题 What would be the preferred way to achieve the following workflow with either Git or Subversion (I have more interest in the Git version, but comparison will definitely be useful): Let's say we had a major release of the product recently and there is a specific polisihin branch called release-2.0.x . The development then continued and several feature branches were merged into the master/trunk (they will later become the part of the upcoming release-2.1.x ). Now, at some point another feature

Split a file with conflict markers

此生再无相见时 提交于 2019-12-05 08:18:41
I am looking for a tool that will split a file that has conflict markers into the two separate files. Is there anything out there that does this already? xxdiff can do that: xxdiff --unmerge myfile.txt it also works if the conflict markers result from a 3-way diff xxdiff --unmerge3 myfile.txt The tool I work for ( ECMerge ) does that, primarily with the target of helping you to merge them visually of course. You could as well save the left/right/ancestor files with the built-in Javascript engine. ECMerge reads markers for most 'well-known' source code controls (CVS, git, mercurial, bazaar,

Git stash pop with binary - merge conflict

点点圈 提交于 2019-12-05 04:46:43
I'm trying to do a "git stash pop" with a binary file. It results in a merge conflict. I just want to pull what's in the stash off and overwrite what's in the working directory. What is the easiest way to do that? To restore all files to their stashed version: $ git checkout stash -- . 来源: https://stackoverflow.com/questions/29979038/git-stash-pop-with-binary-merge-conflict

Git conflict (rename/rename)

a 夏天 提交于 2019-12-04 15:24:39
问题 After merging branched I've received a conflict (rename/rename) on bunch of files, with file~HEAD , and file~my_test_branch created. How to resolve these? Thanks 回答1: Given the following test-setup: git init resolving-rename-conflicts cd resolving-rename-conflicts echo "this file we will rename" > will-be-renamed.txt git add -A git commit -m "initial commit" git checkout -b branch1 git rename will-be-renamed.txt new-name-1.txt git commit -a -m "renamed a file on branch1" git checkout -b