Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git merge while switching to submodule

We are using Qooxdoo framework in our application. For now, it's copy is stored in our Git repository in the root folder "qooxdoo". We have decided to replace that with submodule pointing directly to GitHub Qooxdoo repository, so we can checkout new versions in future more easily.

I created branch for these changes based on master, called qooxdoo-update. Removed old folder completely and added submodule for qooxdoo.

git rm -r qooxdoo
git submodule add git://github.com/qooxdoo/qooxdoo.git qooxdoo

So far this works pretty good. However problem arise when I want to merge master into this branch to keep it updated till other developers can test their code againts new version.

While still in qooxdoo-update branch I issue command:

git merge origin/master

CONFLICT (file/directory): There is a directory with name qooxdoo in origin/master. Adding qooxdoo as qooxdoo~HEAD

then...

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

   added by us:        qooxdoo

running...

git rm qooxdoo
qooxdoo: needs merge
rm 'qooxdoo'
Unlink of file 'qooxdoo' failed. Should I try again? (y/n)

or...

git add qooxdoo
error: unable to index file qooxdoo
fatal: updating files failed

So i am not really sure how to resolve that conflict to successfully finish merging.

like image 408
FredyC Avatar asked Nov 12 '22 15:11

FredyC


1 Answers

If you want to come back to the previous recent version of your file/dir, executing:

git reset HEAD qooxdoo

should work.

like image 98
kenorb Avatar answered Nov 15 '22 05:11

kenorb