*My post explains how to clone a private repository with PAT(Personal Access Token) from Github.
With FGPAT(Fine-Grained Personal Access Token), you can clone a private repository from your account and you can also clone a private repository from your organization if you're its owner or member:
*Memos:
- You need to generate a FGPAT and add it to the command below. *Organization doesn't have FGPAT or PAT generator.
- A FGPAT can select permissions more precisely(finely) than PAT.
-
fgpat
is FGPAT. -
pat
is PAT.
git clone https://<fgpat or pat>@github.com/<your account or organization>/<repo>.git
<How to generate a FGPAT from your account>
Fill Token name, then select All repositories in Repository access. *You can select Only select repositories to only select the repositories you want but don't select Public Repositories (read-only) otherwise you cannot clone a private repository:
Set Access: Read and write for Contents to clone a private repository and to do some basic operations such as
add
,commit
,push
etc.
This is the command with the FGPAT generated above:
git clone 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@github.com/<your account or organization>/<repo>.git
Top comments (0)