Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm finishing my dissertation and want/need to provide the source code of some analysis scripts I've used. I did all the version control with git. Because I want to publish the results generated with these scripts, I don't want to just put them in a public repository on GitHub.

Is it possible to provide an "URL-only" access to a GitHub repo, meaning it is not publicly listed but only visible to persons who have the URL? If not with GitHub, is this possible with another service?

I would like to have some kind of GUI to see the code, which is why I don't want to make a zip file with just the source code in it.

Edit:

To make that point more clear: There should not be any login or registration involved! Type in the URL printed in the dissertation and boom, there's the source code!

share|improve this question

closed as off topic by Glenn Nelson, GlenH7, Jarrod Nettles, Rein Henrichs, Bart van Ingen Schenau Apr 27 '13 at 16:31

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

Bitbucket allows for private repositories. As the repository owner, you can add people to the repository and set whether they have read or write access. They'll need accounts on Bitbucket, but signing up is free.

I actually prefer Bitbucket to Github; the UI is (in my opinion) a little nicer.

share|improve this answer
    
Is it possible to do this URL based? I don't want to have any registration or login involved. –  Eekhoorn Apr 26 '13 at 13:00
    
Not as far as I know. You can set it to public and read-only, but then you're back in the same situation as Github... –  anaximander Apr 26 '13 at 13:29

Did you consider Dropbox? It does not require registration if you send out the public link, it can show you the source code (albeit not very nice), and people can simply download all they need.

This obviously only works if your colleagues do not contribute to your code. To simplify the process, set up a new branch 'Dropbox' or 'Final', and add a post-commit hook which copies the contents of that branch to your public dropbox folder after each commit. Here's a tutorial: http://git-scm.com/book/en/Customizing-Git-Git-Hooks

The idea is that once you finished a certain version of your code that you wish to release, you add it to the respective branch, then the hook is automatically executed and copies the code over to the right directory.


As requested, here's how I deploy my websites on my server:

  • git runs on the server, as user 'git' with its own home-directory

  • I develop offline and, once finished, merge all changes into the 'deploy'-branch, which is the working branch on git.

  • push all changes to the server via ssh (thus the git repo on the server must be bare)

  • the deploy-branch is setup with a hook in /home/git/repository/hooks/post-receive which contains #!/bin/sh /usr/local/sbin/git_update_website.sh

  • This script does the following: #!/bin/bash GIT_WORK_TREE=/srv/www/vhosts/website/httpdocs git checkout -f which copies the contents of the current branch to the specified directory (that's why deploy needs to be the active branch).

On your machine, you would link to the checkout script to ./hooks/post-commit (there is a sample in /hooks/ ) and tell it to check out your code to the directory you specify, for example /home/user/Dropbox/publiccode/

Please note that I'm far from being a git-pro, and there may be easier ways to accomplish this, but this works for me.

share|improve this answer
    
If you wish, I can add an example on how I deploy my website with a hook on linux. –  phi Apr 26 '13 at 13:25
    
that would be great! –  Eekhoorn Apr 26 '13 at 13:25

GitHub Gists allow a URL-only 'secret' access but I don't believe you can clone a repository to it; you'd have to add the files by hand. This is OK for a small number of files but if you have a lot then it probably won't work for you.

However, as gists are git repos, you may be able to push changes to it.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.