WordPress - How to track themes folder only from git repository - wordpress

I have duplicated a WordPress site to my local machine, so that I can work and maintain it. Now assume that someone else has created a custom theme and created a git repository and pushed that custom theme (only the themes folder), so that I can integrate it into my WordPress intallation. How can I sync that theme folder to my WordPress installation?
Do I have to:
- git init
- git remote set-url origin git#github.com:USERNAME/REPOSITORY.git.
or am I wrong? how do I only track the themes folder?
Can someone help me out?

Related

Where to download Git in your local Wordpress directory?

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

git clone and new permissions

I have a repository on github with preset wordpress with a few plugins. I cloned it into my mamp folder to start working on a new project. However something is wrong with the file permissions. During WordPress installation wp could not create wp-config file, so I had to create it manually and when saving it requested an admin password to do so. If I want to update a plugin while in the admin area of this new wordpress site it requires ftp credentials, while if I go to another site in the same mamp folder I can click update and the plugin is updated. I checked the permissions for both wordpress site folders and they are 755. My question is what could trigger such behavior with permissions and how can it be prevented in the future?

Sync local and online WordPress installations

I develop WordPress themes and I use git for version control. I use a git repo for each theme. The most of the time I am fixing and developing themes so I only need to push little changes to some theme. Because of that I only have the themes synchronized but I have differents plugins and content.
Now I want to completely sync my local and online WordPress installations to make any change in local, including create the content and make plugins and core updated.
I have found a plugin that allow to sync the database and media files. But what happens with plugins and all the wordpress core files?
I can make git repo of all the wordpress install, but I don't want to push all the installation because a little change in one theme. I need to track each theme apart.
Is there a way to make a repo of all WordPress, excluding themes, and maintain the repos I already have for the themes?
Finally, my approach has been to create a git repo of all the WordPress files excluding wp-content/plugins and wp-content/themes with the .gitignore.
So then, I have a repository for plugins, a repository for each of my themes and another repository for all the other files. This plus the WP Sync DB plugin allow me to have my local and production environments completely synchronized.
I hope this help someone!

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.

Unable to git pull Wordpress' folders and sub folders from OpenShift repo using Git

I created a wordpress app hosted on Openshift from the CLI. I'm on a Win7 PC.
After that I made several changes to my Wordpress site from the Wordpress Admin Dashboard. Now I want to pull the whole app to my local machine. I did a git pull which fetched the only folders and files sans the actual wordpress app. When I tried to run it using a WAMP, there's no wordpress site to be started. When I again ran
git pull
The message I get is
Already up-to-date
I'm a rookie and I want to make changes to my wordpress site locally and then push them to the server. Please help me out here.
if you are installing plugins & themes via the wordpress admin, they are not in git, they are installed in your $OPENSHIFT_DATA_DIR, and are saved there outside of git, you can see in this script where it does the symlinks into your wordpress installation: https://github.com/openshift/wordpress-example/blob/master/.openshift/action_hooks/deploy
If you want those in git also, you would need to modify that script to remove the symlinks, and then put your plugins & themes in git and do a push.

Resources