Reputation: 61
I have a WordPress parent theme and multiple WordPress website (all on the same filesystem) that use it. So how do I make sure with Git that each instance of the parent theme is synced with the version on Github? Without having to pull each instance individually.
Upvotes: 2
Views: 559
Reputation: 311318
You've asked how to keep multiple local repository clones up-to-date without having to pull each instance individually. Carl-Eric has addressed how to efficiently store multiple repositories on your filesystem. Here are some suggestions on keeping them up-to-date:
One solution would be to set up a post-merge
hook in one of the repositories that iterates across the others and performs the pull
operation:
#!/bin/sh
unset GIT_DIR
for repo in /path/to/repo1 /path/to/repo2; do
( cd $repo && git pull)
done
The post-merge
script is run after a git pull
operation.
Having said that, the simplest option would be to have a single clone of the repository and then symlink to it from the other locations.
Upvotes: 1
Reputation: 1266
First you clone the github repo once to your local machine.
Then you can continue in two ways:
origin
remote pointing to github. You will waste some disk space though, since all copies will obviously have the entire repo in them.origin
will point to the local repository by default, rather than to Github.Upvotes: 0