Hello,
As an on premise Odoo user we sometimes need to change the source code. when we have few changes on source code it is very hard to update the code from main repository.
I am a newbie to git and github, how do I do with git and github ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
As an on premise Odoo user we sometimes need to change the source code. when we have few changes on source code it is very hard to update the code from main repository.
I am a newbie to git and github, how do I do with git and github ?
with this setup I forked a copy of odoo on github. When I will need a code change I will change the code and test on my test server when it is ok I will merge that code change to my github fork.
On the other hand my production server will run from the same github fork and updated from that source when necessary.
If main odoo branches has updates we will update our forked repo from main repository with rebase function thus we will have our changes and updates together.
Steps 1 2 3
~/.ssh/config
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes
git clone https://github.com/yourusername/yourbranch --branch 7.0
git checkout 7.0
Since we cloned 7.0 branch we get a response Already on '7.0'
Already on '7.0'
git branch dev-test1
git branch
outputs
* 7.0
dev-test1
* means you are on that branch we can switch to another branch with git checkout [branchname]
git checkout dev-test1
outputs
Switched to branch 'dev-test1'
git add .
git status -s
This will list changed files in the repo.
git diff --cached
git config --global user.name 'Your Name'
git config --global user.email you@somedomain.com
git commit -m 'Your Commit explanation comes here'
git push origin dev-test1
It will ask for your username and password for github as below. and write a message like below to show your push.
Username for 'https://github.com': aaltinisik
Password for 'https://aaltinisik@github.com':
To https://github.com/aaltinisik/OCBAltinkaya
* [new branch] dev-test1 -> dev-test1
You can now see you commit from github.com
git checkout 7.0
git merge dev-test1
git branch -d dev-test1
git checkout 7.0
git pull origin
git branch -d dev-test1
git push origin 7.0
How do I get the updates from main repository to my server and to my github repository.
git remote add upstream https://github.com/OCA/OCB.git
git remote -v
will have an output like below
origin https://github.com/aaltinisik/OCBAltinkaya (fetch)
origin https://github.com/aaltinisik/OCBAltinkaya (push)
upstream https://github.com/OCA/OCB.git (fetch)
upstream https://github.com/OCA/OCB.git (push)
We see here we have two remote repositories now named origin (our own forked repo on github) and upstream (OCA repo to get future updates)
git checkout 7.0
git fetch upstream
git rebase upstream/7.0
Since we go back in time and changed the history of our repo we should update our github fork with --force parameter
git push origin 7.0 --force
Notes:
~/.ssh/config
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes
from your perspective: is this a scenario for a developer/integrator of for an Oddo/OpenERP 7.0 user with an installation based on the github sources?
Yes :)
I wonder whether that would be a good method to host and maintain custom modules (even if you never touched the original odoo code)
Thanks for the great guide. Just a quick noob question, where can I find the openerp-server.conf file which is usually located in /etc/ when doing a package install. I found one under ../install but is seems to be a sample as settings are not updated here when I change configuration. I tried copying the file manually to /etc and start openerp with the "--conf=" switch but is still does not seem to use that file even though it loads fine. Any help would be appreciated.
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
1
dic 24
|
64 | ||
|
1
ago 15
|
3949 | ||
|
2
jun 21
|
4875 | ||
Rebase staging branch
Resuelto
|
|
1
oct 20
|
5048 | |
|
1
ene 20
|
6334 |