A modern, blazingly fast version control system built in Go
Astral is a next-generation version control system that reimagines how developers interact with their code history. Built with performance and simplicity in mind, it provides a cleaner interface than Git while maintaining enterprise-grade reliability.
- π Blazingly Fast: Blake3 hashing and parallel operations make operations 2-3x faster than Git
- π― Simple Interface: No staging area - just save your changes
- π Stack-Based Workflow: First-class support for stacked changes and patch series
- β‘ Zero Configuration: Works out of the box with sensible defaults
- π Enterprise Ready: Production-grade quality with comprehensive test coverage
- π Cross-Platform: Works seamlessly on Linux, macOS, and Windows
# Build from source
git clone https://github.com/codimo/astral.git
cd astral
make build
sudo make install# Initialize a repository
asl init
# Save changes (no staging area!)
asl save -m "Add new feature"
# View history
asl log
# Create a branch
asl branch feature-x
# Switch branches
asl switch feature-x
# View commit stack
asl stackasl init [directory]- Initialize a new repositoryasl save [files...] -m "message"- Commit changesasl undo- Revert last commit (keeps working changes)asl amend -m "new message"- Modify last commit
asl branch [name]- Create or list branchesasl switch <branch>- Switch to a branchasl stack- Visualize commit hierarchy
asl log- Show commit historyasl show [commit]- Show commit detailsasl diff [commit1] [commit2]- Show differences
asl merge \<branch\>- Merge a branch into current branchasl merge --abort- Cancel ongoing mergeasl merge --continue- Complete merge after resolving conflictsasl resolve \<file\>- Mark file as resolvedasl resolve --ours- Resolve all using our versionasl resolve --theirs- Resolve all using their versionasl status- View repository and merge status
Astral provides powerful merge capabilities with automatic conflict detection:
# Create and work on a feature branch
asl branch new-feature
asl switch new-feature
# ... make changes ...
asl save -m "Implement feature"
# Merge back to main
asl switch main
asl merge new-feature
# β Merge completed successfullyWhen conflicts occur, Astral guides you through resolution:
$ asl merge feature-x
β Merge conflict detected
Conflicted files:
β src/main.go
# Fix conflicts manually
vim src/main.go
# Mark as resolved
asl resolve src/main.go
# Complete the merge
asl merge --continue
# β Merge completedOr use automatic strategies:
# Keep our changes
asl resolve --ours
# Keep their changes
asl resolve --theirs
# Then continue
asl merge --continueSee docs/MERGING.md for detailed merge documentation.
Astral uses a content-addressable storage system with several key innovations:
- Blake3 Hashing: 2x faster than SHA-1 with better security
- Concurrent Operations: Lock-free algorithms for parallel file processing
- Smart Compression: zlib compression for efficient storage
- Object Caching: In-memory cache for frequently accessed objects
.asl/
βββ objects/ # Content-addressable object database
β βββ 12/ # First 2 chars of hash
β β βββ 3456... # Remaining hash
βββ refs/
β βββ heads/ # Branch references
βββ config/ # Repository configuration
βββ HEAD # Current branch pointer
# Build binary
make build
# Run tests
make test
# Run benchmarks
make bench
# Format code
make fmt
# Run linter
make vet# Run all tests with coverage
make test
# Run only unit tests
make test-unit
# Run integration tests
make test-integrationAstral is designed for speed:
# Benchmark hashing performance
go test -bench=BenchmarkHashBytes ./internal/core/
# Benchmark storage operations
go test -bench=BenchmarkStorePut ./internal/storage/Typical results on modern hardware:
- Hashing: ~2 GB/s (Blake3)
- Object Storage: ~50k ops/sec
- Commit Operations: <10ms for typical repositories
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Follow idiomatic Go conventions
- Maintain test coverage above 80%
- Add benchmarks for performance-critical code
- Document all public APIs
- Use structured logging
- Never panic in library code
MIT License - see LICENSE for details
- Repository initialization
- Commit operations (save, undo, amend)
- Branching and switching
- History viewing
- Stack visualization
- Three-way merge algorithm
- Conflict detection and resolution
- Fast-forward merges
- Merge state management
- Conflict resolution strategies
- Custom sync protocol
- Clone, push, pull
- Incremental transfers
- Garbage collection
- Pack files with delta compression
- Interactive timeline
- Git interoperability
Inspired by Git, Mercurial, and modern VCS design principles.
Built with:
Made with β€οΈ by the Astral team