0

I have a repository on BitBucket, currently public, but I would like it to be private. The program I'm developing automatically pulls from the repo on close (for the user, not the developer).

Making it private doesn't work however, because my users don't have an account. Is there a way to create some sort of "user key" which I can just pass with the automatic pull? Also, can I restrict it to pulling only? I know that doing something like this isn't super safe, but it's good enough.

I have searched for hours for this, but obviously either for the wrong thing or I overlooked something. I'm also open for better alternatives.

Matthias Schreiber
  • 2,347
  • 1
  • 13
  • 20
  • 2
    Look into [deployment keys](https://confluence.atlassian.com/bitbucket/use-deployment-keys-294486051.html). Just ship it with your application, then your customers should be able to pull without any problems. – Oldskool May 12 '16 at 13:25
  • @Oldskool I'm not particularly worried if somebody who is not supposed to pull pulls, but I don't want somebody to have my authentication stored on their computer. From what I'm reading this seems to be the case? – Matthias Schreiber May 12 '16 at 13:37
  • Why did I get a downvote? After hours of research I couldn't find anything satisfying. This is probably just because I didn't really know what to look for. Is in not justified to try and get help after that? – Matthias Schreiber May 12 '16 at 13:45
  • No, that's not the case. You can create a *new* key to act as deployment key, don't use your personal key for this (as this would indeed open up too many things). – Oldskool May 12 '16 at 14:48
  • OK, I've read through the tutorial and some other pages. I have my private and public key. I added the public key to Bitbucket. The only question remaining is, how exactly do I ship the public key with my code? – Matthias Schreiber May 13 '16 at 07:38
  • You should deploy both your public and private key in your app, as otherwise the app can't authenticate against Git succesfully. Just put in in any folder in your app and have your checkout process use those keys, as described [here](http://stackoverflow.com/a/4565746/214577). – Oldskool May 13 '16 at 07:41
  • Thanks a lot! I think I can figure the rest out by myself. – Matthias Schreiber May 13 '16 at 07:44

0 Answers0