Maintaining multiple copies of the same file in different repos under different revision control systems
I have developed a wordpress plugin. It’s a jQuery slider.
So, it includes code for slider (in jQuery), let’s say in
slider.js and also the wordpress php files for admin panel.
Now, I have to maintain 3 different project folders.
- Folder/directory involving jQuery file + php files for wordpress plugin repository. WP uses
svn, and a specific folder structure to host plugins there.
- Folder for github main project ( includes jQuery + php files)
- Folder for github pages for
gh-pagesbranch. This folder contains only jQuery files (not the php files used for wordpress) as I am only showing demo of my slider on
Whenever I update my
slider.js file, I need to manually update it in all three folders and push all the three repositories separately.
I need some easy solution to automate the problem.
feel free to suggest edits in question or title.
One Solution collect form web for “Maintaining multiple copies of the same file in different repos under different revision control systems”
Probably the best answer for this is to learn how to use
git-svn to create a
git “clone” of the
svn repository, that is able to correctly interact with the original repository for fetching new changesets and contributing new ones. This is a somewhat different workflow than just plain
git, though, so there’s a learning curve.
In addition, learning to use
git submodule correctly, and fully separating the
jQuery bits into one repository, and the
php bits into a separate repository that is a submodule of the main repository (or some other arrangement of main repository with submodules – I’m not entirely sure which makes more sense to have has the main) would help. Again, though, there’s a learning curve involved, so it may take some time. Proper use of branches in the various repositories is also critical.
For the short term, figuring out the list of commands needed to be run after one copy of the file is updated, and using them to write a script to propagate the changes into the other repositories will reduce the manual workload and help avoid mistakes.