Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Feb 2011
    Location
    Near Houston, TX
    Posts
    495
    Plugin Contributions
    0

    Default Github Local Setup

    I finally got my head around Git with the help of torvista and swguy. So I have a XAMPP server set up locally. I never considered the ability of using git commands just like MS-DOS! lol That is really EASY!

    I have cloned my fork of Zencart to c:/xampp/htdocs/zencart that I want to do normal local development on. Actually installed stores will need to have config files added. Do you just copy the distro-config.php files in and NOT add them to git?

    But I also want to be able to test on 1.5.7 where the database will be different. To me this means a different Head and different config files. So, this morning I cloned the same fork a second time c:/xampp/htdocs/zc157 so I can keep the config files (and databases) unique and the same. For this clone, I want to reset the head to 157. From what I read, this should work with some warnings about branch management. I do not think my branches will be that complex.

    Is this viable?

  2. #2
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,434
    Plugin Contributions
    29

    Default Re: Github Local Setup

    I think that what I really want to know is how you can switch branches (ZC156/157/158) and get that current branch to use the correct database that was created the first time you used that branch to create a new Zen Cart.
    A custom configure with case switch for versions?
    Preventing the warnings for the admin and zc_install folder are done with constants in the admin:

    Code:
    define('ADMIN_BLOCK_WARNING_OVERRIDE', '1'); //bypasses checks in (admin) init_admin_auth to allow admin access when a) the admin folder has not been renamed and b) installer folder /zc_install exists.
    define('WARN_INSTALL_EXISTENCE', 'false'); //bypasses check in (admin) init_errors: prevents a messageStack warning in the admin if the installer folder /zc_install exists.
    files named "dev-whatever" are ignored by Git.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto, Product Listing Sorter...

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,379
    Plugin Contributions
    9

    Default Re: Github Local Setup

    git is very powerful. and while you may think it may be easy, it is very easy to screwup.

    files named "dev-whatever" are NOT ignored by git. files in the .gitignore file are ignored by git for that specific repo.

    see:

    https://github.com/zencart/zencart/blob/v158/.gitignore

    one can also configure a global .gitignore for ones workstation which are not part of any specific repo.

    someone who is new to git changing heads has problems written all over it (IMO). i would suggest reading up on changing branches.

    good luck.
    mxWorks now has premium plugins
    are you using square? have you shown any appreciation with cake on venmo or on paypal?
    called the savior by the chief bottle washer...

  4. #4
    Join Date
    Feb 2011
    Location
    Near Houston, TX
    Posts
    495
    Plugin Contributions
    0

    Default Re: Github Local Setup

    Quote Originally Posted by carlwhat View Post
    git is very powerful. and while you may think it may be easy, it is very easy to screwup.

    files named "dev-whatever" are NOT ignored by git. files in the .gitignore file are ignored by git for that specific repo.

    see:

    https://github.com/zencart/zencart/blob/v158/.gitignore

    one can also configure a global .gitignore for ones workstation which are not part of any specific repo.

    someone who is new to git changing heads has problems written all over it (IMO). i would suggest reading up on changing branches.

    good luck.

    Carl that helps. I did not know that the configure.php files were ignored by Git and that was my problem! Thank you! I have been reading everything I can.

  5. #5
    Join Date
    Feb 2011
    Location
    Near Houston, TX
    Posts
    495
    Plugin Contributions
    0

    Default Re: Github Local Setup

    Quote Originally Posted by torvista View Post
    I think that what I really want to know is how you can switch branches (ZC156/157/158) and get that current branch to use the correct database that was created the first time you used that branch to create a new Zen Cart.
    A custom configure with case switch for versions?
    Yes, that is what I was concerned with. Now that I know configure.php is ignored based on .gitignore, this should be perfectly viable solution. I was worried about locally created files and how that worked with git.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,434
    Plugin Contributions
    29

    Default Re: Github Local Setup

    files named "dev-whatever" are NOT ignored by git. files in the .gitignore file are ignored by git for that specific repo
    Correct.
    To clarify my lazy statement....dev-whatever files are ignored in the zencart repository as defined by an entry in the .gitignore file that is in the zencart repository:

    Code:
    dev-*.*
    someone who is new to git changing heads has problems written all over it (IMO). i would suggest reading up on changing branches.
    I've done plenty of reading, but it is not obvious to me what the pitfalls are of changing branches/HEAD are, in the context that is obvious to you?
    Can you expand a little on this?
    Thanks.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto, Product Listing Sorter...

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,379
    Plugin Contributions
    9

    Default Re: Github Local Setup

    branches and HEAD are not the same thing.

    creating and changing branches is part of the power of git.

    resetting your HEAD puts you in a detached head state. i do not operate so well in said state.

    @torvista you obviously have a process that works for you. but branches and HEAD are different. and being in a detached HEAD state one can lose all commits if a new commit is made on said state.
    mxWorks now has premium plugins
    are you using square? have you shown any appreciation with cake on venmo or on paypal?
    called the savior by the chief bottle washer...

  8. #8
    Join Date
    Feb 2011
    Location
    Near Houston, TX
    Posts
    495
    Plugin Contributions
    0

    Default Re: Github Local Setup

    Again, this Head question could well by my wording mistake on my part. So I have at least one clone of my fork that I can play with so

    Click image for larger version. 

Name:	Untitled.png 
Views:	25 
Size:	7.5 KB 
ID:	20017

    The goal was to be able to bring up an older version to test bug fixes on. Now this says "new" branch which bothers me a bit. Is this actually ZC157? And how are the different releases, A-D noted as they do not appear to be branches. Again, I am a total noob and am trying to tie all the bits I have read into a real workflow here.

    Thank you all for you input and patience.

    Chris
    Attached Images Attached Images  
    Last edited by g2ktcf; 2 Jun 2022 at 01:06 PM. Reason: image was messed up

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,826
    Plugin Contributions
    118

    Default Re: Github Local Setup

    > branches and HEAD are not the same thing.

    Indeed, HEAD is a pointer to a commit.

    > But I also want to be able to test on 1.5.7 where the database will be different.

    If you REALLY want to do this, you'd be better off creating another folder. But remember that 1.5.7 is currently static and not scheduled to be changed anymore, so it doesn't make sense to use git to manage your view of the files - just pull the Zip of 1.5.7d and set it up.

    Here's where branching and changing the current HEAD pointer DOES make sense: suppose @proseLA makes a fix that you want to test out.
    You don't want to just merge it in to your current 1.5.8 because it might still change. So:
    - create a new branch (and switch to that branch) using git checkout -b new-branch-name
    - merge in @proseLA's change
    - test
    - revert back to the true 1.5.8 mainline by saying git checkout v158.
    - (optionally) delete the branch new-branch-name.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #10
    Join Date
    Feb 2011
    Location
    Near Houston, TX
    Posts
    495
    Plugin Contributions
    0

    Default Re: Github Local Setup

    Quote Originally Posted by swguy View Post
    > branches and HEAD are not the same thing.
    Yes, that part is clear but was trying to figure out how to move backward

    Quote Originally Posted by swguy View Post

    If you REALLY want to do this, you'd be better off creating another folder. But remember that 1.5.7 is currently static and not scheduled to be changed anymore, so it doesn't make sense to use git to manage your view of the files - just pull the Zip of 1.5.7d and set it up.
    And yes, this makes sense. Again, my brain wants to understand the workflow for all plausible issues and fixes.

    Thanks!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How do I make a copy of my live site to use on my local MAMP setup?
    By Treece in forum Installing on a Mac Server
    Replies: 1
    Last Post: 5 May 2011, 02:15 AM
  2. Can I setup on ubuntu (local)?
    By raunharman in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 9 Feb 2010, 12:45 PM
  3. Local Courier shipping setup?
    By maxreefer in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jan 2009, 07:59 PM
  4. local SSL setup how do I do it with zencart?
    By torahtrance in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Aug 2006, 07:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR