This question has been flagged
1 Reply
34216 Views

I have installed odoo locally using git

I have added addtional addons-folders (one of them is being used to clone community Modules [git or bzr] from elsewhere), so I have added these folder in the .gitignore.
Apparently that was not the best idea because I get a conflict when I want to pull the newest commits (git pull origin 8.0 [ 76c31de51bf9610fc9f3e383ec1b32981eae7078].

Your local changes of the following file would be overwritten by merge:
   .gitignore
Please, commit your changes or stash them before you can merge


actually as I do not want to add anything in this case so I would be just fine with my local changes of .gitignore being overwritten.

I found out that the better way to exclude these addon folders is to add them in ./git/indo/exclude (because this is not tracked and therefore can be modified without creating a conflict) and that is what I would do now and keep .gitignore in sync with the remote

so I gues I need either to force the merge of .gitignore or commit my local change, so it can be merged. Any suggestions what would be best here? and if it was forcing to overwrite my local changes in .gitignore ... how do you do that?

Avatar
Discard
Best Answer

git checkout -- .gitignore will reset the content of .gitignore.  If you need the changes to be applied later, you can do a git stash save first.  Then pull, then do a git stash pop.

A note on adding your own module.  You can just leave your own module without adding the folder it to .gitignore.  It will just marked as untracked.  As long as you don't add those folder into git, it would be fine.

It would be best if you put all of your custom module into a separate folder outside Odoo.  You can then set Odoo to search addons from multiple folders (https://www.odoo.com/forum/help-1/question/custom-modules-folder-path-29358).

Avatar
Discard
Author

thanks for your advice. I though it would be good to have everything together so I added a folder where I clone Community Modules to. This folder is actually not in my addons path. I have another folder where I put symlinks to the cloned Modules I acutally want to use inside the mentioned 'clone' folder. This folder (with the symlinks) is what actually is added to my addons_path.

Since v7.0 OpenERP/Odoo can accept multiple paths for addons-path. From my experience, separating the official modules from the rest work best to manage upgrades.