The repo-creator is a Python script that allows users to easily initialize, commit, and push a directory to GitHub directly from your terminal.
- Clone or download this repository to your local machine.
- Navigate to the project directory.
- Install the necessary packages:
pip install -r requirements.txt-
Rename the provided .env.template file in the root directory to .env.
-
Open the .env file and replace
your_actual_token_herewith your GitHub Personal Access Token in theYOUR_GITHUB_PERSONAL_ACCESS_TOKENfield.
YOUR_GITHUB_PERSONAL_ACCESS_TOKEN=your_actual_token_hereEnsure to select the "repo" scope when creating your token.
- Save and close the .env file.
To use the script as an alias from any directory, add the following line to your .bashrc, .zshrc, or equivalent shell configuration file:
alias <your_alias_name>='python3 /path/to/cloned/repo/repo_creator.py --alias'Then, source your shell configuration file to activate the alias:
source ~/.bashrcNow, you can navigate to any directory you wish to create a repository for and use your alias directly. Adding the --alias flag removes the step where the script asks you to enter the directory folder to be pushed to Github.
To use the script in interactive mode, navigate to the cloned repository and execute:
python3 repo_creator.pyFollow the prompts to initialize, commit, and push your directory to GitHub.
To use the GUI functionality provided by tkinter, run the script with the --tk flag:
python3 repo_creator.py --tkA GUI window will open, allowing you to select the directory you want to commit and push to GitHub through a user-friendly interface.
tkinterfor the GUI.PyGithubto interact with the GitHub API.python-dotenvto load environment variables from the .env file.