Support » Plugin: Gitium » How to work with localhost

  • Hello there.

    Reagrding Gitium, it seems to be a great plugin! I have installed it on my production site and it is working fine. Ok, but here is a question:

    If I want to have a local copy of this website on my mac and to push all the modifications to the same repo, what would be the setup? I was thinking of migrate the entire site to my localhost, make modifications, test it and push it to the github repo. But how to to that? Install Gitium on localhost? But this way it will commit everything even before testing… Should I use the same .gitignore file that Gitium provides, versioning only wp-content folder?

    In the video, the guy just cloned the repo on his machine…He did not have the entire WordPress on his machine…that is why I am confused. Thanks for any help.

    An keep it up the great work!

    Luis

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Presslabs

    (@presslabs)

    Hi @maurolopes and thanks for this question.

    There are many ways you can achieve this, I’ll share with you how we do it.

    We’re using for the site repos where Gitium is used, the file structure from here:

    https://github.com/presslabs/gitium-base

    You can simply clone it, then copy the file structure, then add your theme and plugin files on top, then push everything to the repo you’ll be using with Gitium.

    It comes with a predefined setup for a local environment that works with Vagrant & Vbox. All you have to do is to import a DB dump, some images and you can find more details about how you can achieve that on this article from our documentation. In this way you’ll be able to do changes and check them locally before getting them pushed to the repo.

    Please let us know if this works as expected for you.

    Best regards,
    Pedro/Presslabs team

    Thanks, but I use MAMP (mac) as my local environment. Any hint on using gitium with this setup?

    Plugin Author Presslabs

    (@presslabs)

    This is something I haven’t tested as I haven’t used MAMP for quite some time now. Would it work if you cloned the repo directly in the MAMP setup? depending on the structure you have with your repo, this would probably be the easiest way. Then you test all changes on MAMP and only commit & push when happy with the result.

    Would something like this work?

    Pedro/Presslabs Support Team

    Yeah, but Gitium generates a wp-content folder that misses some files and subfolders. That is the main problem. I can clone the gitium repo on my wp local installation, but what about the files that git is ignoring?

    Plugin Author Presslabs

    (@presslabs)

    Well, that’s the whole beauty of the gitignore! You can alter the gitignore file in order to fit it to your needs. For example, I don’t see any reason why you’d have /uploads/ or /upgrade/ or /backups/ in git! The main folders that you’d probably be interested in storing in git are: /plugins/, /themes/ and /languages/. Maybe some other specific plugin folders, depending on what you’re using, but that’s about it.

    Getting back to your issue:

    Yeah, but Gitium generates a wp-content folder that misses some files and subfolders.

    Add the files you need on top of the wp-content folder generated by Gitium, then add them to gitignore, so that they won’t be committed in the repo, but you’ll have them for your local MAMP setup. If I’m not mistaken these files will anyway be added by MAMP, so you’ll only need to ensure you’re not committing files that should not get committed to a Git repo (such as backups, logs, etc.).

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.