A fun, interactive Git terminal simulator built with Vue 3, Vite, and Tailwind CSS v4. Practice Git commands in a safe, browser-based environment that mimics a unicorn-themed macOS terminal interface.
- π Support for essential Git commands and workflows
- πΏ Full branch management with proper file tracking per branch
- π Realistic merge conflict simulation and resolution
- π File creation and editing capabilities
- π§ͺ Comprehensive test suite for Git command logic
- π¨ Modern, responsive UI with Tailwind CSS v4
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/devbyray/git-terminal-simulator.git cd git-terminal-simulator
-
Install dependencies:
npm install # or yarn install
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and navigate to:
http://localhost:5173/
The Git Terminal Simulator supports the following commands:
# Repository operations
git init # Initialize a new Git repository
git status # Show the working tree status
git log # Show commit logs
git help # Show help information
# Staging & committing
git add <file> # Add file contents to the index
git add . # Add all files to the index
git commit -m "message" # Record changes to the repository
# Branch management
git branch # List all branches
git branch <name> # Create a new branch
git checkout <branch> # Switch to existing branch
git checkout -b <name> # Create and switch to a new branch
git switch <branch> # Switch to existing branch
git switch -c <name> # Create and switch to a new branch
git merge <branch> # Merge a branch into your current branch
# File operations
ls # List files in the current directory
touch <file> # Create a new file
edit <file> <content> # Edit file content
cat <file> # View file content
# Terminal operations
help # Show help information
clear # Clear the terminal
The Git Terminal Simulator is designed to be an effective teaching tool for Git concepts. Here's how you can use it in educational settings:
Use the simulator during presentations to demonstrate Git commands and workflows without worrying about setup or environment issues. The simulator provides a consistent experience across all platforms.
Create guided exercises for students to follow along:
Example: Basic Git Workflow Exercise
- Initialize a repository with
git init
- Create a file with
touch README.md
- Add content with
edit README.md This is my first file
- Stage the file with
git add README.md
- Commit the changes with
git commit -m "Initial commit"
- View the commit history with
git log
One of the most challenging aspects of Git for beginners is handling merge conflicts. Use the simulator to:
- Create branches with
git branch feature
andgit switch feature
- Make different changes to the same file in different branches
- Attempt to merge with
git merge feature
- Show how to resolve conflicts by:
- Viewing the conflict with
cat <file>
- Editing the file to resolve conflicts
- Staging the resolved file with
git add <file>
- Completing the merge with
git commit
- Viewing the conflict with
Module 1: Git Basics (45-60 minutes)
- Repository initialization
- Making changes and committing
- Viewing history
Module 2: Branching and Merging (60-90 minutes)
- Creating and switching branches
- Making changes in different branches
- Merging changes
- Resolving conflicts
Module 3: Git Workflows (90-120 minutes)
- Feature branch workflow
- Git Flow introduction
- Pull request simulation
-
Start with the basics: Initialize a repository, create files, and make commits.
git init touch README.md edit README.md "# My Project" git add README.md git commit -m "Initial commit"
-
Practice branching: Create multiple branches and switch between them.
git branch feature git switch feature # or git switch -c feature2 # Create and switch in one command
-
Create merge conflicts intentionally: This is a safe environment to practice handling conflicts.
# In main branch edit README.md "# Main branch content" git add README.md git commit -m "Update in main" # Switch to feature branch git switch feature # Make conflicting changes edit README.md "# Feature branch content" git add README.md git commit -m "Update in feature" # Try to merge (will create conflict) git switch main git merge feature # Resolve the conflict cat README.md # View the conflict edit README.md "# Resolved content" git add README.md git commit -m "Resolve merge conflict"
-
Git Fundamentals
- Repository initialization
- Basic commit workflow
- Viewing history
-
Branching
- Creating branches
- Switching between branches
- Merging branches
-
Advanced Topics
- Handling merge conflicts
- Branch management strategies
- Best practices for commits and messages
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
The project uses Vue 3 with the Composition API and Vite as the build tool. The main components are:
TerminalContainer.vue
: Main container for the terminal interfaceTerminalInput.vue
: Handles user inputTerminalOutput.vue
: Displays command outputsFormattedHelpOutput.vue
: Displays formatted help contentuseGitCommands.js
: Core logic for Git command processing
git-terminal-simulator/
βββ public/ # Static assets
βββ src/ # Source files
β βββ components/ # Vue components
β βββ composables/ # Vue composables (including useGitCommands.js)
β βββ App.vue # Main application component
β βββ main.js # Application entry point
β βββ style.css # Global styles
βββ tests/ # Test files
βββ index.html # HTML entry point
βββ package.json # Dependencies and scripts
βββ tailwind.config.js # Tailwind CSS configuration
βββ vite.config.js # Vite configuration
npm test
# or
yarn test
- Support for remote repository operations (clone, push, pull)
- Visual representation of the Git commit graph
- More advanced Git commands (rebase, cherry-pick, etc.)
- Customizable terminal themes
- Shareable scenarios for teaching specific Git concepts
This project is licensed under the European Union Public Licence (EUPL) - see the LICENSE file for details.
- Inspired by the macOS Terminal interface
- Built with Vue 3, Vite, and Tailwind CSS v4
- Special thanks to all contributors and the Git community