Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to setup own git(hub) repositories


bruyndoncx

Recommended Posts

Hi,

 

I've been reading up on git and github and have found some answers, played around in github and with sourcetree app but I still haven't been able to figure out for sure how to set it all up.

 

I found this post quite usefull but it doesn't fully clear everything out.

http://blog.mhartl.com/2008/10/14/setting-up-your-git-repositories-for-open-source-projects-at-github/

 

My situation:

As a lot of people, my store is based on 2.2MS2 with a lot of code changes by contributions or own code.

I would like to on one hand cleanup the code so that only the necessary bits remain, I feel using git with the version control is ideal as it will be easier to backtrack faulty changes later on.

I would also like to keep more current with the official releases and thus are looking for the easy way to incorporate (pull) core changes.

If I master github, I feel I'd be a more productive oscommerce community member, keeping up with the crowd :)

 

My questions:

1) my code is based on MS2, if I now clone oscommerce, this code base is further along.

if I then update the working copy with my own code, it will appear asif this newer code is removed.

Wouldn't it be more logical to start of with an MS2 clone , is that even possible ?

2) is the process steps described in the link, the best way for oscommerce2 ?

3) is it possible to complete these steps with the sourcetree app ?

 

thanks for the help and any insights provided !

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hi Carine,

 

The first part would be usefull to clarify which codes was built in. I dont think that is a good idea to work with MS2 but you can do something like this

 

1. part

Start a new own repository and upload the origin MS2 into it.

Clone MS2 to your locale repo with sourcetree.

Add readme into it commit and push

Create a new branch name as my modifications

Checkout modifications branch

Copy your moded store into your locale MS2 "modifications" repo and you can see the differencies in sourctree

 

Try somehow code separations in commits by logic (payment mod1, checkout mod2, my contrib1, my contrib2 and so on) and you can see your modifications in MS2

 

there could be conflicts that some modification in one file could be part of more contributions so the differencies should be separate into different contribution branches

 

2. part

Do a new fork repository on github with latest osc v2.3.x version

Clone it a new locale repo with sourctree (new tab)

 

You can use your MS2 commits similar like cherry picks on the new v2.3.x local repo, but I think there will be a lot of conflicts which you should solve.

 

 

This solution is not the only one so githubbers could be suggest another ones.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I agree with @@Gergely that there is no magic tool that will help you that much, and in the long run you're probably best off migrating to 2.3.3+ rather than trying to limp along with a 2.2 MS2 base or taking on all maintenance yourself. In a nutshell, you would get a vanilla 2.2 MS2 installation, and compare file-by-file to see what code changes there are against 2.2 MS2. Then you would look at whatever base you're moving to, figure out why the changes are in your store, and figure out what the equivalent is in the new base (and if it's even still needed). If you've kept good documentation on what add-ons were installed and what they provided and why you wanted to install them, as well as the same for custom code, you will be at least half way there.

 

If you know what add-ons were installed, and what they changed (line by line), that could help a lot in figuring out why a particular line was changed.

 

Sure, it's initially more work than trying to keep patching 2.2 MS2, but if you don't do it, you've essentially forked osC, and become responsible for more and more of the maintenance. There will be fewer and fewer add-ons available, and you might not learn about security holes until it's too late. Keeping good records of what was changed, how, and why; will help greatly in future upgrades of base osC. Good luck!

Link to comment
Share on other sites

@@bruyndoncx: I'm starting to a bootstrap 'migration' of my catalog side of my ooold 2.2MS2 site, I will use github to see the changes I did.

 

I learn a little in the github documentation an in this usefull (I think) link:

 

https://www.youtube.com/playlist?list=PLvRMjkCT20cHgaG5vru_9XAjQ12RJ1php

 

In my case, before a 2.3.x migration (what version to address the migration? the one with bootstrap or the 'official?) I will concentrate in the catalog side. Only in html/css changes, not php.

 

So, my current contributions don't be breaking because, in the core side, it would be a 2.2.MS2 site (Frankensteined).

 

My goal is update to a fresh new oscomm release but only when someday I see something that will be 'stable' (in terms of compativility).

 

If you can host your site in a php 5.2, not problem.

 

I agree with @@Gergely @@MrPhil. I vote for a clean 2.3 instead start with your old shop trying to discover if the new code runs well or not (with changes and deletions, cometimes a few code but in other cases with new files and big changes).

 

So, my suggestion (if you deceide to go to the new oscomm) is create another shop in a subdirectory of your web, copy to local and add (one by one) the contributions you need (with git as).

 

If someday I deceide to migrate to 2.3 I will suggest follow this interesting threat:

 

http://www.oscommerce.com/forums/topic/395359-modding-up-a-new-2334-install-documented/

 

IMPORTANT:

 

You DON'T need to create a gighub repository but only use git in local. Git creates a .git directory with all the changes you did. A good documentation of every change will help you.

 

Im my case, I work with netbeans, a free IDE and manages all the git opperations inside it, without the need of external programs or need to update to a remote server.

 

https://netbeans.org/kb/docs/ide/git.html

 

Good luck with your adventure!!!!

Link to comment
Share on other sites

thanks for the feedback and insights - keep it coming ;)

I've been following mort-lemur thread too.

 

I have gone through different bits fo git ebooks and just came across this very insightfull bit of git geeksam that is really really good and fixed my HEAD with an "aha erlebniss".

http://think-like-a-git.net/

 

Looks like I'm probably gonna have a spidernet of branches for the different contributions.

 

I did manually upgrade the catalog upto 2.3.2 so, I think I'll use that as a basis to start compare with my custom shop. I have put in the effort to have modules and even some extra ones.

install a fresh 2.3.4 when it is officially out, which gives me UTF, and then cherry pick functional changes as required.

I do wonder, why isn't oscommerce standardized on $_GET yet, makes for a lot of small changes in my codebase.

 

I'll have a look at netbeans, git integration is definitely a plus

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@bruyndoncx Sounds like an awful lot of work.

 

Like you my 2.2 site was quite heavily modified (in functional areas rather than appearance) - but I found the upgrade to 2.3.3.4 not too bad a job at all, even for my very limited ability.

 

Is it not time to bite the bullet and look at your existing 2.2 ms site and list all the essential features that you need and then investigate if they can be built into a new 2.3.3.4 or 2.3.4 store? - I have managed to do this with a lot of help along the way, and there are only a couple of features that I did have on 2.2 that Im managing to live quite well without on 2.3.3.4.

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

@@bruyndoncx Sounds like an awful lot of work.

quite a tedious job I think, but I'm getting better at things and with git and version control in place, I won't be that much afraid to get rid of code, knowing I can (easily) find it back.

I'm tired with the commented out sections of standard code that I don't use ...

 

Is it not time to bite the bullet and look at your existing 2.2 ms site and list all the essential features that you need and then investigate if they can be built into a new 2.3.3.4 or 2.3.4 store? - I have managed to do this with a lot of help along the way, and there are only a couple of features that I did have on 2.2 that Im managing to live quite well without on 2.3.3.4.

The coder in me can't settle for less - but in essence that is my plan. I just think it could be handy to use git to inventorise/document related changes. Perhaps not, time will tell. But at the end I want a custom version that is more easy to keep up to date.

Would be nice if the contributions where also hosted on github, that would be a personal incentive for me to help make the official versions bugfree/enhanced and get the updates with the push of a button ...

 

I'll go and readup on all 2334 Mort-lemur certified mods ;) BTW is your avator a meerkat ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I'll go and readup on all 2334 Mort-lemur certified mods ;) BTW is your avator a meerkat ?

 

Noooooooo way are they certified - but they do seem to work - Ill pm you a link to my store if you like?

 

A MEERKAT ??? no - Its a Mouse-Lemur AKA Mort from the film Madagascar - This link may explain a little better

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

@@bruyndoncx: Remember that @@burt notes that is not a good idea try to install old contributions in a fresh 2.3 bacause they may don't work propertly and you may found new ones better written and more funtcional. May be in an evening you can remember all the contrib you did on your old store and try to see if there are new ones for 2.3.

 

Is better add instead of compare/check, right? :)

Link to comment
Share on other sites

@@bruyndoncx: Remember that @@burt notes that is not a good idea try to install old contributions in a fresh 2.3 bacause they may don't work propertly and you may found new ones better written and more funtcional.

@@burt, is your concern about

1) not using the tep_db functions and

2) the fact you should now use the (modular) modules for boxes and content ?

 

Any others I should watch out for ?

@@Antonio Garcia, I'm a big girl, I can figure these things out.

 

May be in an evening you can remember all the contrib you did on your old store and try to see if there are new ones for 2.3.

Yeah, git diff will jiggle my memory. I'm well past 40 now, it's only going downhill from here with my memory :D

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@bruyndoncx I know that you know what is best for you (being a coder / shopowner)...

 

Most shopwoners blindly go into these things adding addons that were broken from the beginning then wondering why their shop suddenly doesn't work. In general, my advice for anyone is to avoid addons as much as possible, and instead take the idea of the addon (assuming the shopowner really requires it) and try to simplify it as much as possible into their shop. I see some addons are 100 lines of code, which could be done in 5 lines of code, you know what I mean.

 

Put another way, keeping a shop as close to core as is possible will lead to an easier life when updating in the future, especially for those shopowners who can't read code...

Link to comment
Share on other sites

@@burt: I agree 100% with you.

 

“If you can't explain it to a six year old, you don't understand it yourself.”

― Albert Einstein

 

“Life is really simple, but we insist on making it complicated.”

― Confucius

 

@@bruyndoncx: Sorry if I did something obvious. I'm a old man and I have to admit I'm inside a "sea of doubts" :lol:

 

Good luck with the 'remembrances' and try to avoid nostalgia!!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...