• Resolved emfjsullivan

    (@emfjsullivan)


    Before I start using Revisr I wanted to understand the flow of how it works with wordpress and git. We currently use git for source control so we’re familiar with it overall, but I’m unclear how it will work in a WP environment.

    My environment:
    Bitbucket account
    Host- shared website on bluehost installed w/ WP 4.2.2 and Mysql
    – I installed the latest version of git and made the wp-config.ssh update to point to it’s location (/home1/USER/bin/git)
    1. Question: Revisr Settings/Help is still showing the old version/location of git, how do I get WP to re-read the wp-config file? When I ssh into my account, do a which git, it shows the new location ~/bin/git but in Help it still shows /usr/bin/git which is bluehosts default location.

    Assuming I get that straightened out, what is the general sequence/flow of how to use Revisr + git?

    Do I first do a “git init” in the main directory for the website as it currently is running to get a baseline? If so, that doesn’t grab the database, but I think after the init I can use Revisr?

    After the init, I’m thinking I should push the code to bitbucket for a new repository. How do I include the database as part of that?

    Now lets say I have a repository of the site and the DB, and I use that to create a developers environment will all the same code. Now I have 3 locations with the same code.

    From there, the developer will be making changes to the site, using git/revisr to update bitbucket I assume. Then, when all looks good, I shuld be able to initiate a pull from the production website from bitbucket using Revisr to pull in the new site/db code, right?

    If something goes wrong, I will somehow be able to roll back to the previous version of the site/db using Revisr then by somehow specifying a hash or tag?

    As you can see, I’m just trying to figure out how WP, Revisr, Mysql, git, bitbucket and a developer can all work together for version control. Any answers, comments, guidance would be appreciated.

    Thanks

    https://www.ads-software.com/plugins/revisr/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Expanded Fronts

    (@expandedfronts)

    Hi,

    If you need to change the path to Git, you can add the following to your wp-config.php:

    define( 'REVISR_GIT_PATH', '/path/to/git' );

    If you already tried that with setting the path to ‘~/bin/git’, and that didn’t work, try setting the full/absolute path (usually “~” refers to /home/YOUR_USERNAME/, check with your host if you’re not sure what this means or how to find it. )

    Once you’ve got that set up, you should be able to create a new repo by going to the revisr dashboard and clicking the prompt to init a new repo, alternatively you can create the repository manually and it should pick it up – see https://docs.revisr.io/article/10-setup-an-existing-repository

    Just as an FYI, this entire flow is greatly improved in the next version, which will be released soon.

    To answer your other questions, yes, you can use Revisr to push/pull site changes – just make sure you have the wp-config, .htaccess files, etc. ignored in all repos.

    And then make sure any commits are pushed out/pulled in asap – for example don’t make a bunch of commits on dev and production at the same time – instead work on your feature on the dev server, push it up to master on Bitbucket, log into live site, pull changes in, etc.

    Once you’re comfortable with the process, things like auto push and auto-pull can make things a lot easier, but I recommend taking some time to understand the ideal flow for your environment first.

    Revisr currently supports reverts, you can roll back file changes, db changes, or both.

    And of course, I do recommend manual backups when testing things out initially. Once it’s running and has been tested with your setup, this obviously is not as big as a deal as backups will likely be going to Bitbucket/Github, etc.

    Thread Starter emfjsullivan

    (@emfjsullivan)

    Thanks for the response.

    1. I did update wp-config.php w/ the full path to my new installed git so it looks like the following, but still Help shows bluehost’s version/location.

    /** Define location for Git plugin revisr */
    define( ‘REVISR_GIT_PATH’, ‘/home1/USER/bin/git’ );

    I did do a manual git init and pushed the code (the WP files/directory) manually to bitbucket and it shows there. How can I tell if revisr “sees” my local repository? In the dashboard, I do see a master branch, but I don’t know if I can “view” my files thru revisr or not. IF I go to “Branches”, I see master and one commit (just an initial comment after doing the init), but the checkout/merge/delete are greyed out.

    2. I did a backup of the database via the dashboard, and I see a comment to that effect, but what happens when that’s done? Where does it put the backup of the db and how can I include that w/ the WP files so git can keep track of it and backup it up to bitbucket?

    3. Why would I ignore wp-config.php, .htaccess and other files – they are all part of the config that I need to save aren’t they?

    Sorry for all the ?s, just trying to understand how you’ve done things.

    Thanks

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Hi,

    1. The full path to git in the help tab is actually what has been automatically detected – I see how this can be confusing and this will be made easier with the next release.

    It sounds like Revisr is connected to your repository though and that Git is working correctly (since it’s picking up the master branch and not throwing any errors.

    There is currently no way to view all files through Revisr, just the ones that have been changed when you make a new commit or view an old commit.

    2. When you hit the “Backup Database” button in the dashboard, the files are saved to your wp-content/uploads/revisr-backups folder, and then a new commit is made to save those files. So you shouldn’t need to do anything further to get them into version control in the first place.

    3. You would ignore these files for a few reasons. First, if you’re pushing to a public Bitbucket/GitHub repo, you don’t necessarily want others looking at your config files, etc.

    Second, if you’re also using Revisr to deploy changes to another server, you will generally want the config files, etc. to stay the same on their environment (so if I pushed from a dev server to a production server, I want the production server to keep it’s wp-config.php file and database credentials, etc).

    I hope that helps!

    Thread Starter emfjsullivan

    (@emfjsullivan)

    1. Thanks, now I understand.

    2. I see it now, thanks.

    3. Makes sense.

    Thanks for your patience and answering my questions. I’ll continue to use it to see if I have any other ?s. Thank you too for creating this plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I get an overview of Revisr and git flow in WP’ is closed to new replies.