Home
Home | Blog

iHwy Development Blog

The iHwy team shares their musings about their development experiences.

Using GIT to install OSCommerce Contributions

Posted on September 23, 2009 17:24 by Mike

Adding an oscommerce contribution to an existing site has always been a huge pain.  You have to weed through messy code and figure out where you're suppose to put in the contribution's code without breaking anything.  A lot of time the install instructions for a contribution only give you the line number to work with, and who knows if that line number is going to be accurate in your code or not.  But, today I figured out a much less painful way to do it... using git.  Now, I don't necessarily recommend doing this without first understanding git at least a little... but if you've used git before, here's what you do: 

1. figure out which version of oscommerce the site is based on (usually found part way down in includes/application_top.php; something like "define('PROJECT_VERSION', 'osCommerce 2.2-MS2');")

2. pull that code in to a git repository

3. create a branch in git for the existing site and for the oscommerce code you just pulled in (all branches are pointing at the same place at the moment)

4. checkout the new branch

5. pull down the existing site's code and copy it over everything in the git repository

6. commit changes

7. checkout the oscommerce branch

8. create a new branch for the contribution you want to install

9. check out the contribution's branch

10. install the contribution (this is now much easier since you're installing it in to the base oscommerce code)

11. commit changes

12. checkout the existing site's branch

13. tell git to merge in the contribution's branch

14. resolve any conflicts

15. commit changes

The existing site's branch should now have the contribution's code nicely merged in to it.  This works because both the existing site's branch and the contribution's branch were both based on the same base branch.  This could theoretically be used to merge in multiple contributions and / or upgrade an existing site to the latest oscommerce code base without nearly as much pain as that usually causes.  Of course there will be conflicts and you will have to manually resolve those, but with a good file merge utility, that's not nearly as bad.

 


Comments

October 4. 2009 22:31

mobile application software development

Wow, I never knew that iHwy Development. That's pretty interesting…

mobile application software development India

October 14. 2009 07:27

Peter

I am so glad that I finally got my solution for installing OSCommerce Contributions using GIT. It really gives me a lot of hard times to figure it on how I will do it and your step by step tips Mike was truly amazing answer to my problem.

Peter Denmark

October 15. 2009 10:47

кредити

Your blog is awesome,but you can  boost your traffic if  add more languages.I’m translation specialist and can translate your blog (most articles as well) on Russiаn,Danish and Finnish.Please drop me an email if interested.

Regards,
Chris

кредити

October 21. 2009 22:55

Payday Loans Rhode Island

Looks like you are a full service rig.  Good stuff.  Good suite of services.

Payday Loans Rhode Island United States

October 23. 2009 09:21

cash loans

Nice post . keep up the good work

cash loans United States

Comments are closed