I've been trying for about a full day now to do a simple merge between a feature and develop.
Basically all I want is to be able to manually merge all the conflicts of feature into develop, so that I can get the new feature without destroying develop.
Here are the things I've tried so far
git checkout develop; git merge feature
git checkout feature; git merge -s ours develop
git checkout feature; git merge -s recursive -X ours develop
git checkout develop; git merge -s recursive -X theirs feature
git checkout develop; git merge -s recursive -X theirs feature
git checkout feature; git merge -s resolve develop
In all these cases either branch almost completely overrides the other. I am not given the chance to manually merge conflicts inside files.
git checkout feature; git rebase develop
mergetool is called for some files, but differences in one file are not recognized. It should be noted that this file was previously merged into develop a while ago. Files which were deleted in develop are still present in feature but with an 'orig' extension. This is the closest I've come so far to syncing both branches, but at the price of not being able to easily where the feature branches off anymore.
git checkout develop; git rebase feature
gives a bunch of options to delete or keep files and then results in error: file not found Continue merging other unresolved paths (y/n) ? y
I havent tried cherrypicking or orphaning trees yet. Perhaps the solution lies there?
Is it possible that I deleted some files and recreated them and thats why git is not even trying to combine branches?
Do I need to do manual merge every time I add a new feature? It seems difficult to do Git - how to force merge conflict and manual merge on selected file
I know I messed up somewhere, but I cant figure out where or what I'm doing wrong. I could just manually edit all the files that are not changed, but that would defeat the purpose of using git.
Where did I go wrong? How do I resolve this situation (without manually editing files)? And what should I do differently next time?
P.S. To whoever is new to git and experiencing similar troubles in learning how to use transformative features like merge and rebase
git reflog feature-name
and git reset --hard feature-name@{n}
are invaluable commands. (always use --hard with supreme caution as it discards local changes)
EDIT: While I still dont know why this happened VonC offered a good stop-gap solution.
For anyone who's wondering the way you checkout from a local branch to a new local folder look at this post: https://stackoverflow.com/a/16493707/6419701
The way I conducted a merge is with the excellent meld tool for ubuntu using the syntax: meld folder1 folder2