WordPress.org

Ready to get started?Download WordPress

Forums

Using GIT with local host root directory for theme development (5 posts)

  1. Zach Russell
    Member
    Posted 1 year ago #

    Hello,
    I am running ubuntu 12.04 and have configured a LAMP stack within it. Now that i'm getting into theme development I think it would be wise of me to use soucre code control, and GIT is the way to go in my eyes, I have experience with other programming languages and understand the advantages it, along with ease of deployment.

    Anyway, I know that the www directory (localhost root) is a directory that requires superuser permissions to read/write/execute. How does this interact with git? I just want to know my best way to handle this.

    Thanks
    Zach

  2. kelytha
    Member
    Posted 1 year ago #

    Git has no problems with running as the super user, but to avoid problems you shouldn't try using one local repository with two users.

    If you want to use git both with your normal user and the super user, then you should clone the repository and use git push / git pull to apply the changes from one repo to the other.

  3. Zach Russell
    Member
    Posted 1 year ago #

    Okay, that makes sense, though I may have the wrong idea on how to use git for theme development, i'm new to this aspect of programming. For the best practice, to I create the repo it the web server's root directory, or should I create it in another directory (ie /local-websites/mysite) and copy the site and latest version from there to the root directory?

    I'm not sure what the best practice here is for these kinds of things, and wold appreciate any input.

    Thanks for the advice so far!

    Zach

  4. kelytha
    Member
    Posted 1 year ago #

    For local development it's no problem to deploy straight into the server's root directory. Just make sure if you share your work with others, you don't share your database passwords with them. ;)

    Best way to avoid that is putting the config files and other sensitive things in .gitignore

  5. atmd
    Member
    Posted 1 year ago #

    When I use source control for WordPress theme development (using bitbucket) I tend to have the repo only contain the parent theme folder, and clone that repo to a local install of WordPress.

    That way you don't need to have any unneeded files in your repo or use .ignore files

Topic Closed

This topic has been closed to new replies.

About this Topic