Skip to content

Authentication for private git repository #3794

Closed Answered by svagier
venaturum asked this question in General
Discussion options

You must be logged in to vote

If you are using Bitbucket, you can grant access to a repository using Repository Access Tokens. What's great about them is that you can set permissions very granularly - also "read only". You can revoke these tokens anytime.
To use them (assuming your git repository that you want to include as a dependency is called myproject), run these in CI/command line:

poetry config repositories.myproject https://github.com/org/myproject.git
poetry config http-basic.myproject x-token-auth ${{ YOUR_BITBUCKET_REPOSITORY_ACCESS_TOKEN }}

and then you can simply include it in pyproject.toml:

[tool.poetry.dependencies]
myproject = {git = "https://bitbucket.org/org/myproject.git", branch = "main" }

Replies: 7 comments 18 replies

Comment options

You must be logged in to vote
2 replies
@dnlopes
Comment options

@sriharsha-tnf
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@danseely
Comment options

@radekska
Comment options

@danseely
Comment options

Comment options

You must be logged in to vote
1 reply
@Congee
Comment options

Comment options

You must be logged in to vote
4 replies
@Congee
Comment options

@campanelli-sunpower
Comment options

@Congee
Comment options

@bitphage
Comment options

Comment options

You must be logged in to vote
2 replies
@PhilippeGalvan
Comment options

@tugot17
Comment options

Comment options

You must be logged in to vote
6 replies
@abn
Comment options

@JPHutchins
Comment options

@abn
Comment options

@JPHutchins
Comment options

@ferreteleco
Comment options

Answer selected by abn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment