#
Version Control in Hush
Hush implements a version control system that ensures developers avoid conflicts from using different versions.
#
Overview
The version control system in Hush works on three levels:
- Secret Versioning: Each secret in AWS SecretsManager is automatically versioned
- Local Version Tracking: The
.hushrc.jsonfile tracks local versions - Conflict Prevention: Automatic checks before push operations
#
Local Version Tracking
#
.hushrc.json File
Hush automatically creates a .hushrc.json file in your project directory:
{
"hush-project-dev": {
"version": 5
},
"hush-project-prod": {
"version": 12
},
"hush-api-keys": {
"version": 3
}
}
Note:
- The
.hushrc.jsonfile is automatically updated duringpulloperations - The
.hushrc.jsonfile is used for conflict checking duringpushoperations
#
Version Control in Push Operations
#
Automatic Version Checking
With every hush push, the system goes through the following process:
- Retrieve Current Version: Loads the current version from AWS SecretsManager
- Check Local Version: Compares with the version in
.hushrc.json - Conflict Detection: Warns about conflicts and prevents unintended overwrites
- Version Increment: Automatically increases the version number by 1
- Update Local Tracking: Updates the
.hushrc.jsonfile
#
Example Push Workflow
# Current version in AWS: 5
# Local version in .hushrc.json: 3
hush push my-project .env
# ⚠️ Warning: Current version (5) is greater than your current version (3)
# ⚠️ Use "hush pull" to pull the latest version first
# Solution 1: Pull latest version
hush pull my-project .env
# Local version is updated to 5
hush push my-project .env
# ✅ Success! Version is incremented to 6
# Solution 2: Use force flag (only when sure)
hush push my-project .env --force
# ⚠️ May overwrite newer changes!
#
Version Control in Pull Operations
#
Pull Workflow
- Read Local File: Analyzes the current
.envfile - Retrieve Remote Version: Loads the latest version from AWS
- Detect Changes: Compares local and remote versions
- Request Confirmation: Shows changes before overwriting
- Update Version: Updates
.hushrc.jsonafter successful pull