mirror of
https://codeberg.org/Tealk/git-project-helper.git
synced 2025-11-09 21:01:50 +01:00
No description
| config | ||
| src | ||
| templates | ||
| .gitignore | ||
| app.py | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
Git Project Creator
A Python script that streamlines the creation of new Git project directories. It automates the setup process by creating the necessary directory structure, initializing a Git repository, and adding essential files like README.md, .gitignore, and LICENSE.
Features
- Creates organized project directories within a specified base directory
- Supports project categorization through group directories
- Generates
README.mdand.gitignorefiles from templates - Provides license selection from predefined templates
- Initializes Git repositories automatically
- Offers optional integration with gitignore helper scripts for advanced customization
- Uses TOML configuration files for easy customization
Requirements
- Python 3.6+
- Git installed and available in the system's PATH
- Required Python packages (automatically installed if missing):
tomli(TOML parser)
Installation
-
Clone the repository:
git clone https://codeberg.org/Tealk/git-project-helper.git cd git-project-helper -
Make the script executable:
chmod +x app.py -
Run the script:
./app.py
Usage
Run the script using Python:
python app.py
Or directly if you made it executable:
./app.py
Workflow
- Select a Group: Choose an existing group directory or create a new one
- Enter Project Name: Provide a valid name for your project
- Choose a License: Select a license from available templates or use the default
- Project Setup: The script will:
- Create the project directory
- Add
README.md,.gitignore, andLICENSEfiles - Initialize a Git repository
- Optional Gitignore Helper: If configured, you can run a gitignore helper for custom
.gitignoreconfiguration
Configuration
The script uses TOML configuration files for easy customization:
config/default.toml: Contains default settings (don't modify this directly)config/user.toml: Use this file to override default settings (created on first run)
Configuration Options
[paths]
# Base directory for all git projects
git_base_dir = "~/GIT"
# Directory containing project templates
templates_dir = "~/Templates/Programming"
[templates]
# Template file paths (relative to templates_dir)
readme_template = "Git/README.md"
gitignore_template = "Git/gitignore"
licenses_dir = "Licenses"
[defaults]
# Default values
license = "MIT"
group = "Projects"
[helpers]
# Helper script path (leave empty to disable)
# See https://codeberg.org/Tealk/git-ignore-helper
gitignore_helper = ""
Project Structure
git-project-creator/
├── config/ # Configuration directory
│ └── default.toml # Default configuration settings
├── src/ # Source code directory
│ ├── config_loader.py # Configuration loading utility
│ ├── dependency_checker.py # Checks and installs dependencies
│ ├── directory_utils.py # Directory management functions
│ ├── git_utils.py # Git-related functions
│ ├── license_utils.py # License selection utilities
│ ├── project_creator.py # Main project creation logic
│ └── template_utils.py # Template processing utilities
├── templates/ # Default fallback templates
│ ├── README.md # Default README template
│ ├── gitignore # Default gitignore template
│ └── LICENSE # Default license template
├── app.py # Main executable script
└── requirements.txt # Python dependencies
License
This project is licensed under the AGPL-3.0 License. For more details, see the LICENSE file.