Interactive Git release cleanup and checkout utility.
Project description
🧹 Release Clean — Deterministic Git cleanup and release checkout
Release Clean is a deterministic Git utility designed to clean, reset, and position your local repository into a trusted release state before working on a specific release branch.
Its goal is simple and critical:
Ensure that your local environment is clean, consistent, and aligned with the correct release version, eliminating any hidden state that could compromise reliability.
Release Clean does not automate blindly. It enforces controlled execution, requiring explicit confirmation before any destructive operation.
🎯 Purpose
Release Clean was created to solve a common and dangerous problem in release workflows:
How can we guarantee that a developer’s local environment is not polluted before switching to a release branch?
Typical risks include:
- Residual build artifacts (
ios,android,dist) - Untracked or partially reverted changes
- Outdated branches
- Inconsistent local state across team members
The answer is not convenience — it is deterministic cleanup and controlled execution.
✨ Key Features
-
🧹 Automatic cleanup of local build directories:
ios,android,dist
-
🔄 Reset of tracked changes:
git checkout -- .
-
🌿 Safe synchronization of
main -
🚀 Deterministic checkout of
release/<VERSION> -
🔁 Pull of remote release branch
-
🔍 Validation of:
- Git repository context
- Version format
-
⚠️ Explicit confirmation (
y/N) before destructive actions -
🛑 Immediate stop on first failure
-
📋 Full execution trace (audit-friendly)
-
🎨 Highlighted execution steps (bold magenta)
-
🧩 Zero external dependencies (pure Python)
🧠 Operational Philosophy
Release Clean is built around a strict principle:
A release environment must be deterministic.
It ensures that:
- No residual files interfere with the build or execution
- No local changes silently affect behavior
- The correct branch is always used
- The operator is always aware of what is happening
This tool enforces discipline before action.
⚙️ Executed Workflow
Release Clean executes the following sequence:
rm -rf ios
rm -rf dist
rm -rf android
git checkout -- .
git checkout main
git pull
git fetch --all
git checkout release/<VERSION>
git pull origin release/<VERSION>
This sequence is intentional and ordered:
- Clean local artifacts
- Reset tracked changes
- Synchronize base branch (
main) - Fetch all references
- Move to target release
- Ensure release branch is up to date
🚀 Installation
Requirements
- Python 3.9+
- Git installed and available in PATH
🍎 macOS Installation (recommended)
1️⃣ Install pipx
python3 -m pip install --user pipx
python3 -m pipx ensurepath
⚠️ Restart your terminal after installation.
2️⃣ Navigate to project directory
cd release-clean
3️⃣ Install globally
pipx install .
Now the command is available globally:
release-clean
▶️ Quick Test
release-clean
If the interactive prompt appears, installation is successful ✅
🔍 Optional Checks
which release-clean
pipx list
🧹 Updating
pipx reinstall release-clean
❌ Uninstall
pipx uninstall release-clean
⚠️ Important Notes
- Do not use
sudo pip install - Do not install CLI tools with system Python
- Always prefer
pipxfor CLI isolation
🧠 Rule of Thumb
Python library →
pip installPython CLI tool →pipx install
🧾 Usage
Run inside a Git repository:
release-clean
Flow
- Prompt for version:
Enter version (e.g. 2.100.1 or 2.100.1-hotfix)
-
Validate version format
-
Validate Git repository
-
Show execution plan
-
Ask for confirmation:
Continue? [y/N]
-
Execute workflow
-
Stop on first failure (if any)
-
Print final summary
📌 Version Format
Accepted formats:
1.0.02.100.12.100.1-hotfix3.4.5-rc1
Invalid examples:
1.0release/1.0.0- empty values
📊 Execution Summary
At the end, Release Clean prints:
- 🕒 Start and end time
- 📁 Repository path
- 🌿 Version and branch
- ✅ Successful actions
- ❌ Failed actions
- 📋 Full command list in execution order
This improves:
- auditability
- reproducibility
- communication with team
🛡️ Ideal Use Cases
- Preparing local environment before a release
- Avoiding “works on my machine” scenarios
- Teams working with release branches (
release/x.y.z) - CI/CD validation steps (manual or scripted)
- Regulated or critical systems where consistency matters
🔮 Future Enhancements
-
--dry-runmode -
--versionflag (non-interactive) -
--no-color -
--branch-base(supportmaster) -
CI mode (
--yes) -
Exportable summary (
.md,.txt) -
Integration with:
- Slack
- Discord
- Jira
📜 License
MIT License.
👤 Author
André Argôlo CTO • Software Architect • DevOps
- 🌐 Website: https://argolo.dev
- 🐙 GitHub: https://github.com/argolo
🧭 About
Release Clean reflects a fundamental principle in software engineering:
Reliability starts before execution — it starts with a clean state.
In complex and mission-critical systems, subtle inconsistencies in local environments can lead to unpredictable behavior, hidden bugs, and costly debugging cycles.
Release Clean exists to eliminate that risk.
It is a small tool with a strong purpose: enforce consistency, reduce uncertainty, and protect the integrity of your release process.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file release_clean-0.0.3.tar.gz.
File metadata
- Download URL: release_clean-0.0.3.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f255ec58f50a416ac3d8768a00797b388b624dad732a3e2b21c5f3c492692c90
|
|
| MD5 |
1543c45b6d639c9248abcbc3e96ceb46
|
|
| BLAKE2b-256 |
5dc1806404a69710183e74ee5b951a53ee49d20a626635cb1495b12b15b1d9cf
|
Provenance
The following attestation bundles were made for release_clean-0.0.3.tar.gz:
Publisher:
release.yml on argolo/release-clean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
release_clean-0.0.3.tar.gz -
Subject digest:
f255ec58f50a416ac3d8768a00797b388b624dad732a3e2b21c5f3c492692c90 - Sigstore transparency entry: 1165726128
- Sigstore integration time:
-
Permalink:
argolo/release-clean@5683d628efd2e482e93e7f46f96ddff6aced765a -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/argolo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5683d628efd2e482e93e7f46f96ddff6aced765a -
Trigger Event:
push
-
Statement type:
File details
Details for the file release_clean-0.0.3-py3-none-any.whl.
File metadata
- Download URL: release_clean-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e2f3482de5aea93f7bd9d56d12822c3797583e361d2b799a0f0a96a1b8bd383
|
|
| MD5 |
ce6abef2e1925587d7263cc117a57c2f
|
|
| BLAKE2b-256 |
c5a58c90e979704874fe76bfe2dec615d3897730df194c9651ea31df8f699cdf
|
Provenance
The following attestation bundles were made for release_clean-0.0.3-py3-none-any.whl:
Publisher:
release.yml on argolo/release-clean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
release_clean-0.0.3-py3-none-any.whl -
Subject digest:
9e2f3482de5aea93f7bd9d56d12822c3797583e361d2b799a0f0a96a1b8bd383 - Sigstore transparency entry: 1165726186
- Sigstore integration time:
-
Permalink:
argolo/release-clean@5683d628efd2e482e93e7f46f96ddff6aced765a -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/argolo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5683d628efd2e482e93e7f46f96ddff6aced765a -
Trigger Event:
push
-
Statement type: