This question has been flagged
10 Replies
22076 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

Avatar
Discard

Anyone on this?

Best Answer

I used 

git pull origin 8.0

8.0 can be master or 7.0, etc.

Avatar
Discard
Author

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'

"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.

Best Answer

You can use git reset

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

or

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

 

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

Avatar
Discard
Author

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

"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".

Author

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.

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.

Best Answer

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.

Avatar
Discard