feat: Multi-Platform Support for GitHub, GitLab, and more #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌍 Multi-Platform Support
This PR implements comprehensive multi-platform support, enabling gitshift to work with GitHub, GitLab, GitHub Enterprise, self-hosted GitLab, and provides a foundation for adding more platforms in the future.
📋 Summary
gitshift now supports multiple Git hosting platforms with a clean, extensible architecture while maintaining 100% backward compatibility with existing GitHub-only configurations.
✨ Key Features
🚀 What's New
1. Platform Abstraction Layer (
pkg/platform/)Created a clean abstraction for Git hosting platforms:
platform.go- Core interfaces and types for all platformsgithub.go- Full GitHub support (including Enterprise)gitlab.go- GitLab support with SSH and basic APIfactory.go- Platform factory for easy instantiation2. Extended Account Model
Added multi-platform fields to account configuration:
3. Multi-Platform Operations
🎯 Supported Platforms
📝 Changes
New Files
pkg/platform/platform.go(223 lines) - Platform interfacespkg/platform/github.go(223 lines) - GitHub implementationpkg/platform/gitlab.go(222 lines) - GitLab implementationpkg/platform/factory.go(106 lines) - Platform factoryexamples/config-multi-platform.yaml(142 lines) - Config examplesModified Files
internal/models/account.go- Added platform fields (+69 lines)internal/ssh/manager.go- Platform-aware SSH (+108 lines)internal/git/git.go- Platform-aware Git ops (+90 lines)docs/CONFIGURATION.md- Multi-platform docs (+177 lines)README.md- Multi-platform highlights (+84 lines)Removed Files
Total: 11 files changed, 1,375 insertions(+), 72 deletions(-)
📚 Documentation
All multi-platform documentation consolidated into existing structure:
Configuration Guide:
docs/CONFIGURATION.md#🌍-multi-platform-configurationMain README: Updated with multi-platform highlights
🔄 Backward Compatibility
100% backward compatible - no breaking changes:
🧪 Testing Recommendations
Manual Testing
Automated Testing (Future)
Unit tests needed for:
🎨 Usage Examples
🔐 Security
📊 Impact
🚀 Next Steps
After merge:
✅ Checklist
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com