How to interactively (visually) resolve conflicts in SourceTree / git

From SourceTree, click on Tools->Options. Then on the “General” tab, make sure to check the box to allow SourceTree to modify your Git config files. Then switch to the “Diff” tab. On the lower half, use the drop down to select the external program you want to use to do the diffs and merging. I’ve … Read more

Git resolve conflict using –ours/–theirs for all files

Just grep through the working directory and send the output through the xargs command: grep -lr ‘<<<<<<<‘ . | xargs git checkout –ours or grep -lr ‘<<<<<<<‘ . | xargs git checkout –theirs How this works: grep will search through every file in the current directory (the .) and subdirectories recursively (the -r flag) looking … Read more

How do I fix a merge conflict due to removal of a file in a branch?

The conflict message: CONFLICT (delete/modify): res/layout/dialog_item.xml deleted in dialog and modified in HEAD means that res/layout/dialog_item.xml was deleted in the ‘dialog’ branch you are merging, but was modified in HEAD (in the branch you are merging to). So you have to decide whether remove file using “git rm res/layout/dialog_item.xml“ or accept version from HEAD (perhaps … Read more

Why does git say “Pull is not possible because you have unmerged files”?

What is currently happening is, that you have a certain set of files, which you have tried merging earlier, but they threw up merge conflicts. Ideally, if one gets a merge conflict, they should resolve them manually, and commit the changes using git add file.name && git commit -m “removed merge conflicts”. Now, another user … Read more

INSERT IF NOT EXISTS ELSE UPDATE?

Have a look at http://sqlite.org/lang_conflict.html. You want something like: insert or replace into Book (ID, Name, TypeID, Level, Seen) values ((select ID from Book where Name = “SearchName”), “SearchName”, …); Note that any field not in the insert list will be set to NULL if the row already exists in the table. This is why … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)