Where to download Git in your local Wordpress directory? - wordpress

Where would I download Git on my Local Wordpress Environment So then I can create a branch and use it as a type of test environment. and have access to the other themes?

If you are looking to test plugins and themes, it's most likely that your working directory should be established in /wp-content - it contains both /plugins and /themes. You'll want to make sure you have a .gitignore file that only tracks what you're working on.
If you are looking to work on changes to core, your working directory will almost always be the top-most WordPress root. That way, you can track WordPress/WordPress.

Actually I put my GitHub folder in my themes folder and then I could use the repos in my GitHub folder on my local host WordPress site

Related

How to put Wordpress manually onto Bitnami on local computer?

I use:
Bitnami Wampstack 7.3.17-1
Wordpress 5.4
What I want to do is installing Wordpress manually onto Bitnami on my local PC. I am familiar with XAMPP and WAMPP, so I though what I need to do after unzip the wordpress file is only to put it on htdocs folder. But I couldn't found it on Bitnami, what I can see is apps folder.
Then, because when I tried to access phpMyAdmin I only need to go to: 127.0.0.1/phpMyAdmin/, I thought it will also work for the wordpress. But turns out it's not.
I don't want to use Bitnami-wordpress installer like bitnami-wordpress-5.4.1-0-windows-x64-installer.exe. Because in the future I want to do it for other php-based website I made.
Anyone know how to do it?
Hi Bitnami Engineer here, you can follow these steps to deploy a PHP application on top of WAMP:
Copy the installdir/docs/demo folder into the installdir/apps directory.
Add the following line to the end of the installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf file:
Replace the installdir placeholder with the full installation directory for your Bitnami stack.
Include "installdir/apps/demo/conf/httpd-prefix.conf"
Restart the Apache server using the graphical manager tool.
You should now be able to access the demo application at http://localhost/demo. - You should see a “Hello world” message in your browser.
You can now replace the files inside the installdir/apps/demo/htdocs folder with the WordPress' ones to deploy that application.
You can learn more about this here
https://docs.bitnami.com/installer/infrastructure/wamp/administration/create-custom-application-php/

OpenShift Empty WordPress Repo

I signed up for OpenShift and created a new WordPress application. Went through the typical WP setup screens in the browser, and now have a fresh instance of WP. I need to start hacking away at WP, so I
git clone ssh://<my-app-repo-url> /path-to-my-project
in my shell, but the
/path-to-my-project/php
folder is empty!
I ssh'd into my application and the
/var/lib/openshift/<uid>/app-root/repo/php
folder contains all the WP source. Why is the clone operation not pulling down these files?
When you install WordPress using the quickstart, it downloads WordPress and installs it on your gear, not using git. Refer to the directions here (https://github.com/openshift/wordpress-example) in the readme for more information.

Using wordpress with GitHub

Is it okay to put my wordpress config file (containing database name, username, password, etc.) on my GitHub repo if I'm using wordpress with my website? Or is it not secure? Why or why not?
If it's not secure, what steps can I take to not put on GitHub since it's public but at the same time be able to use GitHub as version control for my website and push files to the server?
No, I would not upload your config file to your repository. Unless it's private, but even then...use caution. As a best practice I only add the theme folder that I am working on into the repository, there really is no need to add Wordpress in its entirety to the repo.
To ignore that file when pushing to your repo add it to your .gitignore (https://help.github.com/articles/ignoring-files/) and it wont be added.
In addition to using .gitignore to keep your wp-config.php file out of your repo, you can also move it one directory above where you have WordPress installed and WordPress will look for it there.

Where to save plugins for openshift wordpress install

I would like to upload a custom installation of openshift. I have installed wordpress and cloned it via git. Now I would like to add manually some plugins and push it back to openshift. Where do I have to put in my extracted plugins/themes?
I appreciate your answers!
Short answer: store your plugins and themes in .openshift.
Longer answer:
Every Openshift account has what can be thought of as a username - a long number like this:
53f1a90f500446c42053423083
Each directory structure features this number so yours:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo/.openshift
will be different to mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo/.openshift
The number gets incorporated into environment variables so that scripts will work on yours and mine equally. One of these is OPENSHIFT_REPO_DIR. On your install it will point to:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo
on mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo
Another is OPENSHIFT_DATA_DIR.
When you push changes from your local directory via git, the deploy script is run and it assembles all the wp files it needs into a directory it names:
OPENSHIFT_DATA_DIR/current
Openshift moves the 'original' wp plugins and themes folders that are created during a wp install into the OPENSHIFT_DATA_DIR/current/wp-content. It looks in OPENSHIFT_REPO_DIR/.openshift for your code and copies in any plugins and themes folders it finds there.
Net effect is to assemble the plugins and themes directories by adding yours to those that came with wp. So, your fully-assembled OPENSHIFT_DATA_DIR/current will have these in it:
OPENSHIFT_DATA_DIR/current/wp-content
/themes
/plugins
/uploads
So, anything you put in .openshift will be copied to the right place, but not altered.https://github.com/openshift/wordpress-example

How to set up git for wordpress theme development

I am setting up 10 new local wordpress sites. I have 10 folders all named like this:
"name-of-site.com"
Inside each is a simple file structure:
briefing files
html
wordpress
I want to set up a repository on git hub for the wp-content file but I can't find a way to create an alias. Surely the end result will be 10 different repos all called "wp-content"
How can I set up a separate repo for each wp-content folder and name it "name-of-site.com"
Is this glaringly obvious and I am being really stupid???
Why not have the top level folted, that is "name_of_site.com" be the repository, and in that folder, you can create a .gitignore file to ignore the other directories you don't want, that is, the html and briefing files (if I understand your layout correctly). That way, you're simply tracking the Wordpress content. You can even move it up a level so that only the briefing files and the HTML are in separate directories and the WP content is in the "name_of_site.com" directory.
Edit:
After your comments, I think you could do it this way:
Create repos for each site you have and put the wp-content of those sites in the .gitignore file
Create one repo for wp-content, which contains all your themes. Organize them according to your needs.
Write a simple shell script that pulls the latest theme into your site's folder from the repo in the previous step. That way, every time you update your theme, you can go to your chosen site and just synch up with the latest pushed version.
Does that make sense?

Resources