Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


how to update Odoo installation with git?

on 7/25/14, 11:51 PM 8,498 views

I have installed a production server ocb-backports Version of Odoo 7.0 with git. Now I wonder what would be the right way to update our installation.

my clone command was (being inside of /opt/ocb)

sudo git clone --branch 7.0 https://github.com/OCA/OCB.git ocb-server  (which creates a git reposittory /opt/ocb/ocb-server).

I think I have to use 'git merge' to update my installation but would like someone more git literate than me to confirm my command is good. Actually I think it is a very similar one then the clone just replacing 'git clone' with 'git merge'

sudo git merge --branch 7.0 https://github.com/OCA/OCB.git ocb-server

Can anyone comment whether that is good or whether ther is mor to this? I am a total newb to git and I am not a programmer or anything. We are only using it to keep up to date with our production server installation. I do not intent to contribute anything from our end to the OCB branch on github (there is noting actually). I want to update my local git repository with any bugfixes or patches that where applied @ https://github.com/OCA/OCB.git


EDIT: I already have a strong feeling the above sudo git merge --branch 7.0 https://github.com/OCA/OCB.git ocb-server is not what you need to do. Still looking for the right command set. I guess it starts with moving into my repository (cd /opt/ocb/ocb-server) and executing a git status, ... then it get's a little blurry already

Anyone on this?

Kyle Krenzer
on 7/30/14, 3:00 PM
Kyle Krenzer
On 7/30/14, 4:51 PM

I used 

git pull origin 8.0

8.0 can be master or 7.0, etc.

I would have thought that the .git/config file would 'know' what branch I am on? but seems that is not always the case. I have seen that there is an entry merge = refs/heads/7.0 so I guess a 'git merge' would know which branch to play with? Furthermore I understand that 'git pull' is kind of a combination og 'merge' and 'fetch'

on 7/30/14, 9:30 PM

"git pull" is great to use when is the developer environment, for work in production in automated way if needed "git reset" do a better job. With "git reset" not need to bored with possible changes made in the production tree.

Rui Andrada
on 7/31/14, 12:19 PM

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
| 5 3 6
Gandhinagar, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 12/7/15, 7:40 AM

Dear Gunnar,

@Elevation Organics is right.

You can update odoo using below step.

1. open the terminal

2. set the path where your odoo is available.

like in my system: cd workspace/openerp/8.0

after this you will see like ankit@ankit:~/workspace/openerp/8.0$

3. type this command git pull origin 8.0 

like: ankit@ankit:~/workspace/openerp/8.0$ git pull origin 8.0

Hope this help for you

Thanks & Regards,

Ankit H Gandhi.

Rui Andrada
On 7/30/14, 3:50 PM

You can use git reset

git fetch && git reset --hard origin/7.0


git fetch && git reset --hard origin/heads/7.0


That will update your checkout to latest commit of remote origin.

interesting, seems there is more then one method to achieve this. I was pretty sure that some kind of 'git merge' would be involved

on 7/30/14, 9:22 PM

"git merge" is used when you need to merge one or more branches. To update a current tree "git pull" is used. When you use "git pull" is the same to "git fetch" followed of "git merge" in current tree. But when you are in production environment is better to use "git reset".

Rui Andrada
on 7/31/14, 12:24 PM

thanks for the feedback. I plaid around with this a little already and got an error with 'git reset' (have not written it down unfortunately). So I was a little in favor og the 'git pull' method. Will contintue testing a little on the way.

on 8/2/14, 6:18 AM

git pull is just "git fetch && git merge" one command for two steps... with "git reset" sometimes you get a better results. but oks if you you think this is not useful, time will tell you.

Rui Andrada
on 10/20/14, 8:36 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)


Asked: 7/25/14, 11:51 PM
Seen: 8498 times
Last updated: 12/7/15, 7:40 AM