Open Contents
Streamline your GitHub project setup with ease! This tool automates the initialization of a local Git repository, seamlessly creates a corresponding GitHub repository, and pushes your code with minimal interaction. Perfect for developers looking to save time and standardize their repository creation process.
Automate repo setup and push with ease!
This Python script automates the process of initializing a local project directory as a Git repository, creating a corresponding repository on GitHub, and pushing the local repository to GitHub. It is designed to be user-friendly and efficient, with interactive prompts and automatic dependency handling.
- Interactive Setup: Prompts for GitHub credentials if not set as environment variables.
- Automatic Dependency Installation: Checks for and installs required Python libraries.
- Initializes a local Git repository: Uses
mainas the default branch. - Creates a new repository on GitHub: Supports public or private repositories.
- Pushes the local repository: Links and pushes your code to the newly created GitHub repository.
- User-Friendly: Simple and clear interactive prompts.
- Error Handling: Provides informative error messages for common issues.
- Python 3: The script is written in Python 3.
- Git: Git must be installed on your system.
- GitHub Account: A GitHub account is required to create repositories.
- Download the
create-github-repo-from-local-dir.pyscript to your project directory. - Make the script executable (optional, but recommended):
chmod +x create-github-repo-from-local-dir.py
To install this project, follow these steps:
-
Download the script to your project directory.
-
Make the script executable:
chmod +x create-github-repo-from-local-dir.sh
-
Ensure you have the necessary dependencies installed:
- The script will check for
curlandjqand prompt you to install them if they are missing.
- The script will check for
- Ensure you have Python installed on your system.
- Install the required module:
pip install requests
- Download the script to your project directory.
master
<<<<<<< HEAD
- Navigate to your project directory in the terminal.
- Run the script:
or if you made it executable:
python3 create-github-repo-from-local-dir.py
./create-github-repo-from-local-dir.py
- Follow the interactive prompts:
- If the
requestslibrary is not installed, the script will ask for your permission to install it. - If your
GITHUB_TOKENandGITHUB_USERNAMEare not set as environment variables, the script will prompt you to enter them. - You will be asked if you want your new repository to be public or private.
- If the
The create-github-repo-from-local-dir.sh script is now deprecated. The Python script (create-github-repo-from-local-dir.py) is the recommended tool as it is more robust, feature-rich, and user-friendly.
=======
master
Khalid
This project was created by Khalid. Connect with me on GitHub to learn more about my projects and professional background.
This project is licensed under the MIT License.
master