Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 开发与实施交流
  4. 如何在OCA上贡献自己的代码?

如何在OCA上贡献自己的代码?

Scheduled Pinned Locked Moved Odoo 开发与实施交流
3 Posts 2 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liliane.lielico-corp.com
    wrote on last edited by
    #1

    系统环境:ubuntu 14.04 LTS

    1. 在github上注册自己的账号,github注册网址:https://github.com
    2. 用git推送自己的代码到OCA上的中国代码库:https://github.com/OCA/l10n-china
        2.1 将OCA的l10n-china库fork到自己的github里,创建自己的远端l10n-china代码库
        2.2 将自己的远端代码库克隆到本地
            方式一:https(提交代码的时候要输入github账号密码)  git clone https://github.com/Rona111/l10n-china.git br />        方式二:ssh(需要添加ssh key,可以直接提交)  git clone [email protected]:Rona111/l10n-china.git
        2.3 检查本地的remote情况,拉取远端OCA库的链接,以便代码同步(采用ssh方式)
            git remote -v (查看已有remote)
            git remote add upstream [email protected]:OCA/l10n-china.git
            git remote -v (重新查看,确认已增加远端OCA库的链接)
        2.4 在本地的git上创建自己的分支,并在自己的分支下工作
            git checkout -b  add_module_hr_to_oca
        2.5 提交自己的工作内容
            git commit  输入主题或关键字
            ctrl+X && Y 退出并保存
        2.6 推送本地的分支到自己远端的代码库
            git push --set-upstream origin add_module_hr_to_oca(首次提交,后续只要键入git push)
        2.7 到github上根据自己提交的内容提示,提交一个pr(Pull Request)
    3. 修复改进自己的代码
      当你提交你的代码后,如果有人对你的成果提出建议或意见,我们可以在本地修改自己的代码,重复2.5和2.6操作。

    进阶git技巧:

    1. 将远端未被合并的的pull request拉到本地
      git fetch upstream pull/9/head:new_local_branch_name_pr_9
    2. 同步远端的代码库到本地
      方式一: git pull
      方式二:(建议使用) git fetch --all && git merge 9.0 upstream/9.0

    1 Reply Last reply
    0
    • 1 Offline
      1 Offline
      149145776qq.com
      wrote on last edited by
      #2

      赞!

      1 Reply Last reply
      0

      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Tags
      • Popular
      • Users
      • Groups