This repository contains two Python scripts that work together to create a new project structure and manage Git operations:
create_project.py
: Creates a new project structure with predefined directories and files.git_manager.py
: Manages Git operations for the project.
- Python 3.6 or higher
- Git installed and configured on your system
-
Clone this repository or download the scripts:
create_project.py
git_manager.py
-
Place both scripts in the same directory where you want to create your new projects.
To create a new project with the predefined structure and initialize Git:
This will:
- Create a new directory with the given project name
- Set up the project structure (directories and files)
- Initialize a Git repository
- Create a .gitignore file
- Make an initial commit
- Create a save point (Git tag)
The git_manager.py
script can be used independently for Git operations:
-
To initialize Git and push to a remote repository:
python git_manager.py <remote_repo_url>
-
To make a commit with a custom message:
python git_manager.py "Your commit message here"
-
To perform local Git operations without pushing:
python git_manager.py
This script:
- Creates a project directory with the given name
- Sets up predefined subdirectories (src, tests, docs, data, config)
- Creates initial empty files (README.md, requirements.txt, .gitignore, etc.)
- Calls
git_manager.py
to initialize Git for the new project
This script provides functions for:
- Initializing a Git repository
- Creating a .gitignore file
- Adding files to staging
- Committing changes
- Creating save points (tags)
- Setting up a remote repository
- Pushing changes to a remote repository
- Creating and switching branches
- Modify the
DIRECTORIES
andFILES
lists increate_project.py
to change the project structure. - Edit the
gitignore_content
ingit_manager.py
to customize the .gitignore file.
- The scripts use logging to provide information about the operations being performed.
- Error handling is implemented to catch and report issues during execution.
- Make sure you have the necessary permissions to create directories and files in the location where you run these scripts.
Feel free to fork this repository and submit pull requests to enhance the functionality of these scripts.
[Specify your license here]