# Cannot add private repository from GitHub

**URL:** https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900
**Category:** New to Julia
**Tags:** github, ssh
**Created:** [July 28, 2022, 1:07am UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900 "2022-07-28T01:07:49Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)
#### Post date: [March 11, 2023, 4:25pm UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900/21 "2023-03-11T16:25:20Z")

</div>

I tried that as well and that does not work.

I think that the problem is that I am not sure what the permissions on the tokens should be. When I set the permission for my specific repository, it does not “stick”. I mean - I hit “update” but then I see there is no access configured for that repository.  
Should I choose specific permissions from the list? There are so many permissions there, and that seems weird.

---

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [March 11, 2023, 6:18pm UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900/22 "2023-03-11T18:18:46Z")

</div>

Yes, there are a lot of settings, I used the fine-grained pat. I used the following fields:

Token name  
Expiration  
Description  
Only select repositories  
Select repositories  
Repository permissions  
Contents (set to Read-only)  
Generate token

---

<div class="post-metadata">

### Author: ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)
#### Post date: [March 13, 2023, 3:19am UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900/23 "2023-03-13T03:19:04Z")

</div>

I set all of these, but apparently, I also had to choose specifically some of the repository permissions. After doing that, I could add my package. Thanks!

---

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [May 16, 2023, 12:40pm UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900/24 "2023-05-16T12:40:52Z")

</div>

Today I ran into a related issue.  
My use case is the following:  
I have a dockerfile which is using a private repository (a Julia package). Thus I `activate` and `instantiate` that package.  
The package has dependencies which are other private repositories.

The following worked for me. In package mode you can add a private repository like this:

`add "https://ghp_my_personal_git_access_token@github.com/kafisatz/TBManagerProxmox.jl.git"`

> **[Managing your personal access tokens - GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)**
>
> You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.

[Previous page](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900.md?page=1)
