OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Git Integration for client site

This topic contains 4 replies, has 2 voices, and was last updated by  indabanathan 7 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #31196

    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
  • #31197

    Michael
    Keymaster

    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.

    #31198

    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.

    #31199

    Michael
    Keymaster

    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.

    #31200

    indabanathan
    Participant

    You are awesome Michael!!

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

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top