1

I want to publish a specific subdirectory of a repo via Dropbox, so that directory is publicly downloadable without giving access to the entire repo on Github.

First thing I tried was to symlink from Dropbox to the git project folder (e.g. ln -s /path/to/project/dir ProjectName from within my Dropbox public folder). Then I realized this would change the files every time I switched branches in the repo locally to do work.

Is there some way I could symlink to the version of the directory on the master branch, so it will only change the files in Dropbox when master changes?

1 Answer 1

1

Instead of trying to copy many files to Dropbox, you could considering publishing an archive (a compressed version of the subdirectory you want, at the version that you want)

That would be an "on-demand" process: you would rebuild the archive any time you want to update the content of the archive.

See "git-archive a subdirectory":

git archive -o /path/to/Dropbox/subarchive.zip HEAD:subdir 

The archive has no git history in it, but for "publication" that could be enough, and I have seen issues with a git repo in Dropbox before.

You could automate the process with a post-commit hook which would check the current branch (master or not) and make the archive.

Sign up to request clarification or add additional context in comments.

1 Comment

Was able to combine this with a branch-specific post-commit hook to publish the files. Awesome. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.