A user-friendly command-line wrapper for Git that simplifies common Git operations with an interactive menu interface.
Oleksandr Izotov
- 🚀 Full Sync - Add, commit, and push in one command with interactive file selection
- 💾 Quick Commit - Add and commit without pushing with interactive file selection
- ✅ Interactive File Picker - Select files using arrow keys and checkboxes (Space to toggle, Enter to confirm)
- 🆕 Project Initialization - Initialize new Git projects with .gitignore
- 📥 Clone Repository - Easy repository cloning
- 🔄 Pull Changes - Quick pull from remote
- ↩️ Reset Changes - Reset or clean working directory
- 📊 Status Display - View repository status
- 📁 Directory Navigation - Navigate between projects easily
mygit/ # Root project directory
├── mygit/ # Main package directory
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Entry point for python -m mygit
│ ├── colors.py # ANSI color codes
│ ├── git_wrapper.py # Core Git wrapper functionality
│ ├── ui.py # User interface and menu
│ └── commands/ # Command modules
│ ├── __init__.py
│ ├── sync.py # Sync commands (commit, push, pull)
│ ├── repository.py # Repository management
│ ├── status.py # Status commands
│ └── navigation.py # Directory navigation
├── mygit.py # Main executable script
├── README.md # This file
└── .gitignore # Git ignore rules
First, clone or download this repository:
git clone <repository-url>
cd mygitInstall required Python packages:
pip3 install -r requirements.txt# Navigate to the project directory
cd /path/to/mygit
python3 mygit.pycd /path/to/mygit
python3 -m mygitAdd to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
# Replace /path/to/mygit with the actual absolute path to the project
alias mygit='python3 /path/to/mygit/mygit.py'Then reload your shell configuration:
source ~/.bashrc # or source ~/.zshrcNow you can run mygit from anywhere!
This makes the command available system-wide:
# First, get the absolute path to mygit.py
cd /path/to/mygit
pwd # This shows the absolute path
# Create symbolic link (replace with your actual path)
sudo ln -s /absolute/path/to/mygit/mygit.py /usr/local/bin/mygit
# Example: if your project is in /home/username/projects/mygit
# sudo ln -s /home/username/projects/mygit/mygit.py /usr/local/bin/mygitImportant: Use the full absolute path, not ~ (tilde), as it may not expand correctly with sudo.
To verify the installation:
mygit --help # Should show the programIf you need to remove or fix the link:
sudo rm /usr/local/bin/mygitSimply run the program and follow the interactive menu:
mygitThe navigation feature includes customizable quick links. You can modify them in mygit/commands/navigation.py to match your directory structure. Default examples:
- Personal projects folder
- University/work projects folder
- Home directory
- Documents folder
To customize, edit the navigate_directory() function in navigation.py.
- Navigate to your project directory (option 8)
- Make changes to your code
- Choose "Full sync" (option 1)
- Select files interactively:
- Use ↑/↓ arrow keys to navigate
- Press Space to select/deselect files
- Press Enter to confirm selection
- Enter commit message
- Done! Selected files are added, committed, and pushed
When you choose "Full sync" or "Just commit", you'll see an interactive menu like this:
Select files to add:
Use ↑/↓ arrows to navigate, Space to select, Enter to confirm
❯ ◯ [M] mygit/commands/sync.py
◉ [M] mygit/git_wrapper.py
◯ [?] new_file.txt
- Arrow keys (↑/↓) - Navigate through files
- Space - Toggle file selection (◯ = unselected, ◉ = selected)
- Enter - Confirm selection and proceed
- Ctrl+C - Cancel operation
Status indicators:
[M]- Modified file[A]- Added/staged file[D]- Deleted file[?]- Untracked/new file[R]- Renamed file
- Python 3.6+
- Git
- Python packages (install via
pip3 install -r requirements.txt):- inquirer>=3.4.0 (for interactive file selection)
This project follows clean code principles:
- Separation of Concerns: Commands, UI, and core functionality are separated
- Single Responsibility: Each module has a single, well-defined purpose
- DRY (Don't Repeat Yourself): Common functionality is centralized
- Modularity: Easy to extend with new commands
- Readability: Clear naming and documentation
Free to use and modify for personal and educational purposes.
This is a personal project, but suggestions are welcome!