DEV Community

Super Kai (Kazuya Ito)
Super Kai (Kazuya Ito)

Posted on • Edited on

Clone a private repository with PAT from Github

Buy Me a Coffee

*Memos:

  • My post explains how to clone a private repository with FGPAT(Fine-Grained Personal Access Token) from Github.
  • My post explains useful IPython magic commands.

With PAT(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 PAT and add it to the command below. *Organization doesn't have PAT or FGPAT generator.
  • A PAT cannot select permissions more precisely(finely) than FGPAT.
  • pat is PAT.
  • fgpat is FGPAT.
  • usr is username.
  • org is organization.
  • repo is repository.
git clone https://<pat or fgpat>@github.com/<usr or org>/<repo>.git
Enter fullscreen mode Exit fullscreen mode

<How to generate a FGPAT from your account>

  1. Go to Settings:
    Image description

  2. Go to Developer settings:
    Image description

  3. Press Generate new token (classic) from Personal access tokens/Tokens(classic)/Generate new token:
    Image description

  4. Fill Note, then check repo. *If repo is not checked, you cannot clone a private repository:
    Image description

  5. Press Generate token:
    Image description

  6. Finally, a PAT is generated:
    Image description

This is the command with the PAT generated above:

git clone https://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@github.com/<usr or org>/<repo>.git
Enter fullscreen mode Exit fullscreen mode

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay