ssossossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Forums Forums OroCommerce Git Integration for client site

This topic contains 4 replies, has 2 voices, and was last updated by  indabanathan 1 year, 5 months ago.

  • Creator
    Topic
  • #31598

    indabanathan
    Participant

    My company is gearing up to setup a client site. My question is about setting up GIT into our development workflow. Installing the platform requires GIT (https://github.com/orocommerce/orocommerce-application.git), which I don’t want to get rid of for future updates and such. We will have some customizations (theming, plugins/modules, etc). So my question how would I integrate my own Git repo into this site without removing the ability to do future update/upgrades? Any advice?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #31599

    Michael
    Participant

    You can fork the repository on GitHub to your organization (and make it private), or you can clone the repository to any other system or your company source code server.
    You will be able to pull in new updates from our repository as usual (our repository becomes what they call “upstream” repository for your fork).

    GitHub has quite concise and short explanation of the process in general – https://help.github.com/articles/syncing-a-fork/ , it applies not only to GitHub.

    #31600

    indabanathan
    Participant

    Playing around with some git things, here is what I did (my company uses Bitbucket instead of Github). From what I can gather, Github’s “Fork” feature simply renames origin to the original remote path (https://github.com/orocommerce/orocommerce-application.git) to “upstream” and sets “origin” to your own repository.

    For our purposes, we don’t typically want to see all “upstream” commits inside of our own repository.
    So after installing the Oro site, I did:
    mv .git .git.orig
    git init
    git remote add upstream https://github.com/orocommerce/orocommerce-application.git
    git remote add origin https://bitbucket.org/indabagroup/oro.git
    git add .
    git commit ‘initial commit’
    git push -u origin master

    After that, I have a clean/single commit repo that my company can use to track our changes, but I can always merge upstream/branch into my origin/branch

    Does that make sense? Do you think that will work? I’ve not done much multi-remote work before, but I think this will work.

    #31601

    Michael
    Participant

    You can have as many remotes in the repository as necessary, and you can rename them as you like.

    BitBucket supports cloning from GitHub:
    – go to Repositories -> Import Repository
    – type: Git, URL: https://github.com/orocommerce/orocommerce-application.git
    – check “This is a private …” checkbox
    – click “Import repository”
    and in a few seconds you are done.

    Now any developer in your team can clone this BitBucket repository, push and pull changes to it:

    Whenever the time comes to pull some changes from Oro, do the following on your local copy:
    – if not added yet, add our repository as another remote:

    – fetch changes from Oro:

    – merge the changes from our master branch to your current branch:

    – push to your team repository on BitBucket:

    Removing the original git history (killing .git folder) usually complicates the things significantly, I do not recommend to do it.

    #31602

    indabanathan
    Participant

    You are awesome Michael!!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.