ZribeDev / GitShit

"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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitShit

Description

"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.

Setup and Installation

Compatibility Note

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.

Prerequisites

  • Python 3.x
  • Git

Installation Steps

  1. Clone the Repository Clone the GitShit repository to your local machine:

    git clone https://github.com/ZribeDev/GitShit
    cd GitShit
  2. 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 to True to enable email modifications.
  3. 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.
  4. Install Dependencies

    • Install the required Python modules using pip:
      pip install -r requirements.txt
  5. Prepare the Execution Script

    • Make the start.sh script executable:
      chmod +x start.sh

Usage

  • 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.

Contributing

Feel free to fork the repository and submit pull requests with your contributions.

License

This project is open-sourced under the MIT License.

About

"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.

License:MIT License


Languages

Language:Python 92.2%Language:Shell 7.8%