Using different folder names for different deployments of the same repository
On local development, and on the test server, the public folder is public_html
, but o开发者_Go百科n production it’s html
. I’d like to avoid changing too many settings – is there a way for Git to understand these are the same folder?
Edit
Here’s the structure for reference:
Test server
- webapp
- app
- core
- public_html
- index.php
Production server
- webapp
- app
- core
- html
- index.php
Symbolic links would save the day, assuming a sane platform. Git can store the symbolic link.
I'd have the symbolic link be the dev/test server name, not the production name.
You should use a smudge/clean script to move the files to the place you want on your dev machine. When your working tree is updated, the files are "smudged" so they come out as public_html/somefile.html. When you commit changes, the tree that gets saved will be "cleaned" and the files will be stored as public/somefile.html.
http://progit.org/book/ch7-2.html
Hope this helps
精彩评论