A cross-platform, interactive tool to seamlessly configure your Git environment on Windows and Unix-like systems. It handles identity management, SSH key generation, and folder-specific profiles with zero external dependencies.
- Cross-Platform Support: Native scripts for Windows (PowerShell) and Linux/macOS (Bash).
- Interactive Setup: Guided configuration for global user identity (Name/Email).
- Folder-Based Profiles: Manage distinct identities (e.g., Work vs. Personal) for specific directory trees. Now supports assigning specific SSH keys to each profile.
- Advanced SSH Key Management:
- Manage multiple SSH keys via a dedicated menu.
- Generate keys with custom names.
- Delete unused keys directly from the tool.
- Automatically map keys to projects using
core.sshCommand.
- Zero Dependencies: Relies only on standard OS tools and Git.
- OS: Windows 10/11
- Shell: Windows PowerShell 5.1+ (PowerShell 7+ recommended)
- Git: Must be installed (the script can help install it via Winget/Chocolatey)
- Shell: Bash 3.2+
- Git: Pre-installed or available via package manager (apt, dnf, brew, etc.)
You can run this tool by cloning the repository or executing a one-liner directly from your terminal.
-
Clone the repository:
git clone https://github.com/perezdap/git-setup.git cd git-setup -
Run the script:
-
Windows (PowerShell):
.\setup.ps1
-
macOS / Linux:
chmod +x setup.sh ./setup.sh
-
Note: These commands fetch the latest version from the main branch.
-
Windows (PowerShell):
iex (irm https://raw.githubusercontent.com/perezdap/git-setup/main/setup.ps1)
-
macOS / Linux:
curl -sL https://raw.githubusercontent.com/perezdap/git-setup/main/setup.sh | bash
If you encounter an error stating that "running scripts is disabled on this system," you need to set the execution policy for your current session:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope ProcessThe script attempts to install Git if it's missing, but if the installation fails, please install it manually from git-scm.com.
Contributions are welcome! If you have suggestions for improvements or encounter bugs, please open an issue or submit a pull request.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'feat: Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.