An automation for GitHub repository creation, both in GitHub and locally in your chosen path.
The only thing you need to install is the PyGithub package.
pip3 install PyGithub
or:
pip install PyGithub
- After cloning the project:
-
edit
credentials.py
:github_username = 'miLkBoi2' github_password = '1234helpme56'
-
and add your credentials.
- Then, just run
python3 app.py
- Running the script (
python3 app.py
) - You are asked where do you want the local repository to be created in (absolute path).
[ABSOLUTE PATH]
(for example: /home/jack/Desktop)
(paths are case sensitive)
> /home/mectos/Downloads
- You are asked how do you want to name your repository.
[REPOSITORY NAME]
> new_repo
- Given that there were no errors in the process, a new repository will be created both in GitHub and locally.
You have successfully created the repository new_repo
Both locally and in Github.
The local repository absolute path is /home/mectos/Downloads/new_repo
Create an alias for it in your .zshrc
or .bashrc
.
For example, in my case I created this:
alias repo="python3 ~/github/automated-repo-creation/app.py"
So now whenever I type repo
in my terminal
I'm able to create the repo in just a few seconds.
This small project was possible with the help of the great package PyGithub.