Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SourceTree and GitHub Leader needed


Dan Cole

Recommended Posts

Anyone interested in walking some of us through the ins and outs of using SourceTree and GitHub?  I think there are a few, and maybe more then a few shop-owners, who could help out with small coding issues or who might otherwise benefit from maintaining their own code changes using GitHub, if only they knew how.   I'm one of them.

If you're interested in either learning how to use SourceTree and GitHub or leading a thread on this topic please post your interest here.  If there is interest I'm sure we can make it happen.

Dan 

Link to comment
Share on other sites

  • Replies 106
  • Created
  • Last Reply

Here are some relevant links - sadly I haven't mastered it yet- so sign me up :)

 

LINKS

--------

related thread i started in summer last year

http://www.oscommerce.com/forums/topic/397078-how-to-setup-own-github-repositories/

 

and another started by harald on git apps with link to sourcetree faq

http://www.oscommerce.com/forums/topic/392239-git-applications-pc-and-mac/

 

Harald's explanation on how to contribute in github to oscommerce 2.3x and 2.4

http://www.oscommerce.com/forums/topic/397703-github-development-workflow/

 

explanation on what to do as a showowner willing to contribute - written by nick weisser ex oscommerce german teammember

it is written for wordpress, and bitbucket, but replacing wordpress with oscommerce and bitbucket with github and it pretty much covers the essence

https://www.openstream.ch/developer-blog/wordpress-development-workflow/

 

There is a wiki on github from some sharepoint project where I think people essentially have the same getting started issues (not sure if you can clone and adapt that wiki to oscommerce :D )

https://github.com/GSoft-SharePoint/Dynamite/wiki/Getting-started-with-SourceTree,-Git-and-git-flow

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 think the best is to use an IDE.

 

PhpStorm : https://www.jetbrains.com/phpstorm/

sublime text 3 : www.sublimetext.com/

 

Else to use a specific tool for git :

 

search Git on google and you will find some tools to use. 

 

 

The common command are :

 

git commit

git push

git checkout 

git merge


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Being more shop owner than coder I am not an expert, but I use both Github and Sourcetree.

 

On Github I follow several individuals who work on standard osc2 and bootstrap oscommerce.  

 

Simply following and observing gives a decent feel as to what's going on, where things are going and so on.  I pull commits that look to be finalized into my github forked repos then.  Just to keep up.  I've even made my own repos there for work specific to something I wanted to do in a shop.  For example: 

 

https://github.com/skleiner/paypal-invoice-paid-fix

 

is one that I've referred folks to when I notice their question on the same topic in the forum.

 

I think it would be helpful if add ons we're mirrored on Github.

 

But most of my hands on stuff is via Sourcetree.  Using Sourctree, I can clone a Github repo right on to my computer which is very handy when I want to update or compare something I am working on.

 

For example, when 234 bootstrap was active  o:) every time there was an update to the 234 bootstrap repo I would use Sourctree to pull those changes immediately onto my local computer which I then used to update my 234 bootstrap shop code accordingly.  So my version of 234 bootstrap is 40 some commits (changes) ahead of 234 bootstrap gold.

 

With Sourcetree you can easily go through commit by commit and see what the changes are just for that commit.

 

Sometimes I'll test a commit out on my local uniserver set up to see the results.  Now and then I've found a bug or something that I report to the author.

 

There's a learning curve for Github and Sourcetree for sure.  But if you like to get hands on with coding I really helps.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

So jump right in

 

Start by creating an account on github...it's free

 

Look around for something to watch/follow.  Here's one:

 

https://github.com/osCommerce/oscommerce2

 

Follow it.   Even give it a star.

 

Then set up your own repo, just for fun

 

Should go like this...click the repositories tab...click the NEW button...give the repo a name, and even add a description.

 

Unless you want to pay, make it public.

 

And initialize with a README.  Put whatever you want in the README

 

And there you go.

 

You can delete the repo, add and remove branches right from here.

 

And that's about all I've really done on for hands on stuff as far as working with my own repo on Github.  

 

The rest I do on Sourcetree.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Wow....this is awesome and while I feel a big headache coming on, as they say no pain no gain.   I'm going to give Steve's @@altoid suggestion a go here and maybe everyone can do the same.  After that we can download SourceTree and try to connect it up. 

 

Thanks @@altoid, @@Gyakutsuki and @@bruyndoncx.  

 

I'll keep you all posted.

 

Dan

Link to comment
Share on other sites

@@Gyakutsuki

 

I think the best is to use an IDE.

 

Loic...I could be wrong and often am but I think that is what SourceTree is and I only suggested because it seemed like others on here were already using it and could likely show us the ropes....

 

Dan

Link to comment
Share on other sites

@DanCole

 

I am not  familiar with SourceTree because  I am under Linux. This tool does'nt exist for Linux

 

For me I use the command above and I use PhpStorm, that is for me the best tools for environment development than I use today.

 

After, a tool is always personnal, some prefer to use Gedit or something like that, others another tool. 

 

phpstorm do SourceTree, after is how to use and your need. (phpstorm is not free like intelligi and come from java environment)

 

If I remember there is a discussion on IDE month ago.


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Okay I followed Steve's directions in post 5 and now have a repo on GitHub.  I have no idea what to do with it but I have one.   I then went off to SourceTree at http://www.sourcetreeapp.com/ and downloaded and installed the Git client for Windows...sorry Loic.

 

At this point I assume I need to tell SourceTree where my repo is so I'm off to figure that out.  I'll be back to let you know how I to do that or if I stumble, I'll be back asking for help.

 

Dan

Link to comment
Share on other sites

Okay I was able to get SourceTree to connect to my GitHub repo. There is a Clone/New icon at the very top of SourceTree that allows you to fill in the connection information for GitHub and then specific where you are going to store your local copy.  

 

I had a bit of trouble figuring out what went where but after a little trial and error I got it to connect.  All of the icons at the top of the SourceTree navigation bar, that were shaded out, are now accessible.  

 

At this point I think we need a little project to work on so we can see what the possibilities are.  As I recall greasemonkey reported a bug recently so maybe we could fix that as a way to get familiar with how this works.  Are you up for that Steve? @@altoid

 

Dan   

Link to comment
Share on other sites

Sure we can give it a try.  If we can't figure it out there's some more expert help here in the ranks that can help us see the light.  

 

For osC purposes, note there is a main repository for osCommerce 2.  While in the past Herald was the main gate keeper, it appears that Gary is doing much of that now.

 

If you watch the osCommerce2 repo, you should get notices when someone does a pull request for a new/revised/updated piece of code.  Sometimes you'll see Gary is doing his own pull request sometimes.  Other times the pull request is from another person.

 

Take a look here on Github

 

https://github.com/osCommerce/oscommerce2

 

Look to the right and you'll see pull requests.  A bunch of them.

 

Every so often, probably when Gary gets time, and once he's satisfied with the code, he'll pull the new code into the repo, and thus make it part of the core.

 

If the pull request doesn't fit for whatever reason, Gary will close the pull request and no changes are made.

 

Or.....

 

If you have the osCommerce2 repo cloned to your system via SourceTree, just keep and eye on that.   Without you doing anything, you'll see a red number above where it says pull.  That means the oscommerce2 repo has been updated and you need to pull those changes into your system.

 

Easy to do, click the pull button and you get a pop up giving you options before you proceed.

 

I generally just check the commit merged changes immediately.  Proceed.

 

The next pop up shows you what's happening.  Check the full output box.  That way you see all the git commands that Sourcetree is doing for you.

 

When it's finished close that box and the red number goes away and now  your local files are all caught up.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Also see 2 videos:

1. Make an Account at Github and Fork a Repo



2. Check your fork is up to date with Master


At this point, your fork, is YOUR Master.

Let's assume that your Master is a copy of the "Responsive osCommerce" project.

General advice:

a] You should never EVER change your Master.
b] If you want to make code changes, you split up the changes into mini projects (eg; change buttons, add XS to some divs, make a new widget module, etc etc).
c] For one of these mini projects, make a BRANCH of your Master called "Code-Update" (or whatever). In this Branch you make your changes for the project you are working on. Once happy, you PUSH your branch to Github.
d] At this point, you can make a PULL REQUEST to the main core, which is basically you saying; "my work is good, it needs adding to the main core code".

It is here where the magic happens. The owner of the repo where you made that pull-request gets notified and can then pull your code into a branch he has made, to test it. If the test is good, it is possible that the code gets into the core (at this point, the testing branch is pushed, a pull request is made and the code gets merged. If the test is not ideal, your pull-req would be closed.

e] At this point, you can now ;

e.1] Delete your "Code-Update" branch. It is no longer needed.

e.2] Optimise your code further to make it better, and try another PULL req.

f] Change back to your Master in Sourcetree and hit the PULL button. To pull into your Master any changes made in the Main Master.

g] Make a new branch "Button-Update" (or whatever) for your next mini-project. Start coding, repeat the process. You can have many Branches on the go at one time.

In effect, your Master is never ever EVER changed by you. It is only changed by accessing the PULL button. Changes are PULLed from the master of whatever project you forked. Any changes you propose are coded by you in a BRANCH of your Master.

Summary

- You never ever change your Master.
- You make any code changes in a Branch.
- You propose code changes from your branch to the main master.
- Once accepted or declined, you delete your branch as it is no longer needed
- Keep your master up-to-date with the main Master

For the osCommerce project

- please don't submit PULL-requests for code that is not 100% tested, I hate having to remove code because it turns out to be broken.
- please don't submit PULLs for addons, I have no interest in loading osCommerce
- please don't get upset if your PULL request is declined.

Link to comment
Share on other sites

@@altoid Thanks again Steve.   I reveived an email notice that Gary merged (pushed I guesss) update #342 so I'm alive. 

 

I guess the next step is for me to fork the oscommerce repo and I see from Gary's post below that he shows us how to do that in one of the youtube videos so I'll put that on my list of things todo tonight and let you know how I get on.

 

After that I guess we can tackle that bug fix and see what that process is all about.

 

Hummm....I wonder if anyone else following along?

 

Dan 

Link to comment
Share on other sites

Sounds like a plan.

 

That way you can add branches, as Gary noted, right there in Github.  Then with Sourcetree then you can pull the branch locally, then push your work on the branch back to the Github branch where others can see what's going on, contribute hopefully and so on.  I think that's the way to do it.  Or at least one way.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

@@altoid

 

So far so good Steve...I created a fork of oscommerce2 (I hope that is the latest version that Gary is maintaining and updating) and then opened SourceTree and added the repo.  Looking around on both my hard drive and via SourceTree I can see that I now have a copy of all the osC files on my local disk and in my Github account. 

 

On Github I also have a test repo that I set up yesterday and also one that I seem to have created for the fork but don't need so I'm wondering if you know how to delete the unused repos from GitHub?  I don't see an option to delete those.

 

Dan

Link to comment
Share on other sites

Okay now that we have our Master it looks like I'll need to follow these steps in Gary's post #13, a few posts above.
 

General advice:

a] You should never EVER change your Master.
b] If you want to make code changes, you split up the changes into mini projects (eg; change buttons, add XS to some divs, make a new widget module, etc etc).
c] For one of these mini projects, make a BRANCH of your Master called "Code-Update" (or whatever). In this Branch you make your changes for the project you are working on. Once happy, you PUSH your branch to Github.
d] At this point, you can make a PULL REQUEST to the main core, which is basically you saying; "my work is good, it needs adding to the main core code".

 

 

The change that we want to make was mentioned by @@BrockleyJohn where he mentions a fix for a bug that was discovered by @@greasemonkey.  The post reporting that can be found here.

http://www.oscommerce.com/forums/topic/399514-bugs-in-gold-version-of-234-responsive/?p=1725915

So if I understand this correctly I need to make a BRANCH from my Master and we'll call it "Code-Update" in keeping with Gary's post.  I'm now off to have a look at that and will report back later.

Dan

Link to comment
Share on other sites

@@altoid

 

So far so good Steve...I created a fork of oscommerce2 (I hope that is the latest version that Gary is maintaining and updating) and then opened SourceTree and added the repo.  Looking around on both my hard drive and via SourceTree I can see that I now have a copy of all the osC files on my local disk and in my Github account. 

 

On Github I also have a test repo that I set up yesterday and also one that I seem to have created for the fork but don't need so I'm wondering if you know how to delete the unused repos from GitHub?  I don't see an option to delete those.

 

Dan

 

In Github, click on the rep, then look for settings to the right, click, scroll to the bottom.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

@@altoid

 

In Github, click on the rep, then look for settings to the right, click, scroll to the bottom.

 

Thanks Steve...I would never have found that.  GitHub is all clean and shinny now. :)

 

Dan

Link to comment
Share on other sites

I'm also starting with this, by now I'm working with git-cola under linux.

Sorry if I'm asking what follows in the wrong place. I'm trying to start working with the oscommerce2 repo and I was planning to make a pull request related with the datepicker i18n that I made before in Gary's Responsive-osCommerce repo (that now seems a bit abandoned in favor of oscommerce2, which I hope is good news in the long run). But after downloading and running the installation I'm not able to make a datepicker appear on the catalog. In fact, any change I make in the Modules section of the Admin side (like installing, activating or deactivating modules, or changing their sort orders) seems to have no effect on the front end. I wonder if this has to do with some new caching feature I don't know how to deal with. Does anyone know why this happens?

Link to comment
Share on other sites

@@Kolingua

 

Juan you're probably right about questioning whether this is best place to ask a question like that...I don't know the answer and I'm not sure how many folks will see your question buried in here so you might want to start a new topic and post it there...I would suggest in the 2.4 directory. 

 

Good luck with it...

 

Dan 

Link to comment
Share on other sites

A little progress...I created a BRANCH on GitHub and also within SourceTree...it was quite easy really...in GitHub you can just select the branch drop down and type in a name and hit enter.  It will create the BRANCH for you.   In SourceTree it was also very easy to do.  There is a BRANCH icon on the tool bar.  Just click and enter the branch name and it'll create a branch for you.

 

After creating the BRANCH in SourceTree I had a look around and was puzzled by a couple of things.  Small things really but things I wanted to change and couldn't figure out how...the first was the sort order of the directory listing...I'm use to the Explorer sort which groups the directories in alpha order followed by the files in alpha order.  It is very easy to get around.  SourceTree just seems to sort both directories and files in alpha order and I couldn't seem to change that.

 

Imaged attached.

post-182953-0-54798300-1428461611_thumb.jpg

 

The second thing was a limitation in the file contents window which seems to be limited to 100 lines...I wanted to increase that but none of the changes I made had any effect.  Does anyone know how to make it show all lines or at least to expand it beyond 100 lines when you want to see more?

 

Image attached.

 

post-182953-0-34999300-1428461902_thumb.jpg

 

Dan

Link to comment
Share on other sites

@@Dan Cole

Thank you Dan, yesterday I was too tired, but that's what I suspected, now a file named configuration.cache is created even if "use cache" is set to "false", and by now it must be manually deleted when you make configuration changes for them to apply.

Link to comment
Share on other sites

This is turning into a good thread for resources about github and sourcetree.  Good way to learn.   :thumbsup:

 

What's the github address of your project?

 

Regarding the tree, I don't use that view much, so it's never been an issue for me, but I see your point.

 

Regarding the number of lines showing, same thing, I don't use file status view much but you can open that particular file and see the entire thing in your text app.  Right click the file.

 

I use log/history view the majority of the time.  It is here I can see changes ongoing, comments, and general information on a commit by commit basis.  The diff changes are shown then in the window to the right.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...