Skip to main content

A tool for comparing Git branches

Project description

Git Diff Tool

Welcome to Git Diff Tool! A simple yet powerful command-line utility designed to compare two branches of a Git repository and save their differences into a file. Whether you're working on a feature branch or resolving conflicts, this tool makes it easy to spot changes between branches.

Features

  • Compare two branches of a Git repository (e.g., main and dev).
  • Output the differences between the branches into a specified directory.
  • Easy to use and flexible for any Git project.

How to Use

1. Running the Diff Tool

Use the following command to compare two branches of your Git repository:

python3 diff_tool.py \
--repository="https://github.com/<username>/<repository>" \
--main-branch="main" \
--local-branch="dev" \
--save-dir="/path/to/save/diff" \
--target-folder="."

Parameters

  • repository: The URL of your Git repository. Example: https://github.com/username/repository
  • main-branch: The branch you want to compare from (e.g., main).
  • local-branch: The branch you want to compare to (e.g., dev).
  • save-dir: The directory where you want to save the diff output file.
  • target-folder: The target folder where the diff operation will be performed.

2. Example Usage

Here's an example that compares the dev branch with a feature-branch and saves the output to the /home/user/documents directory:

python3 diff_tool.py --repository="https://github.com/username/sample_project" \
--main-branch="dev" \
--local-branch="feature-branch" \
--save-dir="/home/user/documents" \
--target-folder="."

3. Interactive Mode

If you don't provide some of the parameters, the tool will prompt you to input them interactively. Simply run the command without arguments and the tool will guide you through the necessary steps.

python3 diff_tool.py

You will then be asked to enter details like the repository URL, branch names, save directory, and target folder. This command compares the dev branch with the feature-branch and saves the differences in the specified directory.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_diff_tool-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_diff_tool-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file git_diff_tool-1.0.0.tar.gz.

File metadata

  • Download URL: git_diff_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for git_diff_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 df6bb48d8b0bf3eaccf2c35f23f4f7e9f1a5166d9032bcab3f623989b664f0d9
MD5 ea4f32c34e3779dc2ec1613c24508cca
BLAKE2b-256 dfc47492db510558504246fa5614e0c002035304cf953e4fd722a302fa7d8597

See more details on using hashes here.

File details

Details for the file git_diff_tool-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: git_diff_tool-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for git_diff_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf3e5878b3517994face13dc78e241f5d192bbc8bdb54154e977c1c5ea2563c2
MD5 5deb6881d333111c7b6aa61e6b86508a
BLAKE2b-256 435d2f8fb2ebb376e21b493370ca948f761f6690dd69a0a46de2b8b1c3894b9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page