0

I'm using asp.net and WebDeploy to publish the latest bits of my website. The production site has a couple folders that I would like to keep in sync, though.

Since it's an asp.net site, I would rather not have my entire repository on the server when I can get by with just the views and dll. Additionally, I would rather not add the extra clutter of additional class projects & files to my production server file system.

How do I keep the folders in production in sync with the master branch in git? An automated solution would be optimal.

Jim Geurts
  • 20,189
  • 23
  • 95
  • 116

2 Answers2

0

you could create a git hook that will export your files using git archive to create a zip (or tar) to a tmp folder. Then, uncompress the files to the given tmp folder, finally, transfer them to your server.

Also, check this answer Do a "git export" (like "svn export")?

Community
  • 1
  • 1
Cesar A. Rivas
  • 1,355
  • 1
  • 10
  • 13
  • I think you may have the process backward. I'm more interested in getting the updated assets into git. This includes if someone deletes a file as well. – Jim Geurts Feb 03 '11 at 15:11
0

Setting up a scheduled task to commit those files to their respective git repositories will work. It's not ideal, but it will make sure those repositories are relatively up to date with the assets on the live site.

Jim Geurts
  • 20,189
  • 23
  • 95
  • 116