0

take this scenario ->

  • You have a git project foo, with a readme.md
  • You have another git project, bar, which is essentially just the website for foo
  • The website will have a documentation section
  • The bar documentation will be the same as foo's readme.md

How would you handle this? Is there a way that I could only have to update foo's readme.md, and everything on the other end sync with it?

Perhaps an idea is to require the readme.md from the other repo, but not sure how I would do that.

Stepan Parunashvili
  • 2,627
  • 5
  • 30
  • 51
  • You could try some sort of script to be run in bar which pulls in the README for foo, like a commit hook-style thing. – APerson Sep 29 '14 at 01:55

1 Answers1

1

Stepan,

You're essentially looking at replication between your foo and bar repositories.

I'm not sure what system you're running, but there are a plethora of different options available. Windows has many, such as File Replication Service and Peer software. If you're on a linux/mac osx system, the fun way of doing this would definitely be through using IFTTT with github. Essentially all you have to do is create a trigger with IFTTT pointing your foo repository, looking out for changes, and then pull in the new changes into your bar repository. The IFTTT blog on GitHub channels has so many cool demonstrations to get you started.

Some interesting replication services built on top of IFTTT include a Dropbox <-> Google Drive, a Dropbox <-> Box, and a Dropbox <-> OneDrive example. All of these show you how the basics of triggering work and how you can update your html file once the other README.md file has been modified.

Also note, with linux-kernal based systems, I created something very similar to what you're trying to achieve using rsync. Also note, there is also a way you can work with symlinks and git in order to just point to the same file, and have a script massage the README.md file contents into your html file.

Please let me know if you have any questions!

Community
  • 1
  • 1
Devarsh Desai
  • 5,984
  • 3
  • 19
  • 21
  • Stephan, so happy to help!! Thank you for your time and please let me know if you run into any problems or if you have any other questions! :0) Hope you have a great week ahead!! – Devarsh Desai Sep 29 '14 at 04:16