This Bash script accepts the name of a private repository and clones it into the current folder... because I am too lazy setting up ssh.
-
Add Your GitHub Token and Username:
- Open
clonme.sh
and add your private GitHub token in theGITHUB_TOKEN
variable. - Add your GitHub username in the
YOUR_USERNAME
variable.
GITHUB_TOKEN="your_github_token_here" YOUR_USERNAME="your_github_username_here"
- Open
-
Make the Script Executable:
- Change the permissions of the script to make it executable.
chmod +x clonme.sh
- Move the Script to /usr/local/bin:
- Move the script to a directory that is included in your PATH, such as /usr/local/bin, and rename it to remove the .sh suffix.
sudo mv clonme.sh /usr/local/bin/clonme
- Source Your .bashrc:
- Ensure your .bashrc is sourced to update the PATH.
source ~/.bashrc
You can now use the script by simply typing:
clonme <name_of_your_repository>