"GitShit" is a straightforward Python script designed to identify and modify author names and emails in git commits. It scans for specified unwanted keywords within commit author details and replaces them with user-defined values.
While "GitShit" has only been tested on Pop!_OS, a Debian-based distribution, its reliance on Python and Bash suggests it could also be compatible with non-Debian based Linux distributions. However, this broader compatibility has not been explicitly verified.
- Python 3.x
- Git
-
Clone the Repository Clone the GitShit repository to your local machine:
git clone https://github.com/ZribeDev/GitShit cd GitShit
-
Create and Configure the Environment File
- Rename
.env.example
to.env
:mv .env.example .env
- Edit the
.env
file with your specific details:GITHUB_USERNAME
: Your GitHub username.GITHUB_TOKEN
: Your personal GitHub token.UNWANTED_KEYWORDS
: Comma-separated list of unwanted keywords.NEW_NAME
: New name for replacing in commits.NEW_EMAIL
: New email for replacing in commits.CHANGE_EMAILS
: Set toTrue
to enable email modifications.
- Rename
-
Generate a GitHub Token
- Navigate to GitHub Tokens to generate a new token with necessary permissions.
- Important: Ensure that the token has the
repo
permission, which provides all repository permissions. This is crucial for the script to function correctly as it needs to access and modify repository data. - Place this token in the
GITHUB_TOKEN
field in your.env
file.
-
Install Dependencies
- Install the required Python modules using pip:
pip install -r requirements.txt
- Install the required Python modules using pip:
-
Prepare the Execution Script
- Make the
start.sh
script executable:chmod +x start.sh
- Make the
-
To execute the script once:
python main.py
-
To run the script multiple times, use:
bash start.sh [amount]
Replace
[amount]
with the number of times you want to run the script. If[amount]
is not specified, the script will run once by default.
Feel free to fork the repository and submit pull requests with your contributions.
This project is open-sourced under the MIT License.