5 releases
new 0.1.7 | Jan 14, 2025 |
---|---|
0.1.5 | Jan 14, 2025 |
0.1.2 | Jan 14, 2025 |
0.1.1 | Jan 14, 2025 |
0.1.0 | Jan 14, 2025 |
#653 in Development tools
215 downloads per month
7KB
76 lines
🔄 PR Conflict Resolver
A simple Rust tool to help manage Git pull requests and resolve merge conflicts with the develop branch.
✨ Features
- 🔄 Automatically checks out PR branches
- 🔀 Merges develop branch automatically
- 📦 Handles package management (pnpm)
- 🛠️ Creates fork branches when needed
- 🔧 Configurable with command-line options
📋 Prerequisites
Before using this tool, ensure you have:
- ⚙️ Rust installed on your system
- 🌿 Git installed and configured
- 📦 pnpm installed
- 📂 Access to the target repository
🔧 Installation
-
Clone this repository:
git clone https://github.com/your-username/pr-conflict-resolver.git cd pr-conflict-resolver
-
Build the project:
cargo build --release
🚀 Usage
Basic Command
pr-resolver <pr_number> [--no-interactive] [--work-dir <path>]
Arguments
Argument | Description | Required |
---|---|---|
pr_number |
The number of the PR you want to work with | Yes |
--no-interactive |
Run without interactive prompts | No |
--work-dir |
Specify a custom working directory | No |
Examples
# Basic usage
pr-resolver 123
# Non-interactive mode
pr-resolver 123 --no-interactive
# With custom working directory
pr-resolver 123 --work-dir /path/to/work/dir
🔄 Process Flow
- Attempts to check out the PR branch directly (
pull/{number}/head
) - If checkout fails:
- Creates a new branch named
pr{number}_fork
- Fetches the PR branch
- Checks out the new fork branch
- Creates a new branch named
- Merges the develop branch into the current branch
- Runs
pnpm clean
andpnpm install --no-frozen-lockfile
⚠️ Error Handling
The tool handles various scenarios:
- 🔄 Git command failures
- 📦 Package management errors
- ⌨️ Invalid command-line arguments
- 🔧 Missing required parameters
🤝 Contributing
Contributions are welcome! Feel free to:
- 🐛 Report bugs
- 💡 Suggest features
- 🔧 Submit pull requests
📄 License
MIT
A tool for managing pull requests and resolving merge conflicts