Git
Clone Private GitHub Repo
git clone https://<github-username>:<PAT>@github.com/<your-repository>.git- In GitHub, go to
Settings-->Developer Settings-->Personal access tokens. - Click
Generate new tokenand assign the token a name. - Grant the token privilege to the repo group.
- Copy the token to a secure location. You won't be able to view the token again.
- At the bottom of the page, click Generate Token.
Make a Private Clone of a Public Repo
# Create an empty private repo
# Clone the upstream repo
git clone --bare https://github.com/<upstream-user>/<upstream-repo>.git
cd <upstream-repo>.git
# Push the content to the empty repo
git push --mirror https://github.com/<user>/<repo>
cd ..
rm -rf <upstream-repo>.git/
# Add upstream
git clone https://github.com/<user>/<repo>.git
cd <repo>
git remote add upstream https://github.com/<upstream-user>/<upstream-repo>.git