Note: Currently available for Windows. Support for Linux and macOS is coming soon.
Easy Git Switcher is a Python-based GUI application that allows you to manage multiple GitHub profiles using OAuth authentication. Built with PyQt5, this tool enables you to switch between different GitHub accounts seamlessly. It securely stores your credentials using the system's keyring.
- Add Multiple GitHub Accounts: Authenticate with GitHub using OAuth and add multiple accounts.
- Switch Between Profiles: Easily switch between different GitHub profiles.
- Manage Profiles: Add and edit tags for each profile, display profile details (name, username, email), and see which profile is currently in use.
- Load Existing Profiles: Automatically load existing profiles from the Git credential manager.
- Prevent Duplicates: Avoid adding duplicate profiles.
- Windows OS
- Python 3.10.14 or higher
- pip 24.2 or higher
git clone https://github.com/RealHaris/easy-git-switcher.git
cd easy-git-switcher
You can install the required packages using the requirements.txt
file:
pip install -r requirements.txt
Alternatively, you can run the setup.py
script:
python setup.py
The application requires a GitHub OAuth CLIENT_ID
to authenticate with GitHub. You need to create a .env
file in the root directory of the project and add your CLIENT_ID
.
- Go to GitHub Developer Settings.
- Click on "New OAuth App".
- Fill in the required details:
- Application name: Easy Git Switcher (or any name you prefer)
- Homepage URL:
http://localhost
- Authorization callback URL:
http://localhost
- After creating the app, you will be provided with a Client ID and a Client Secret. Copy the Client ID.
In the root directory of the project, create a file named .env
and add the following line:
CLIENT_ID=your_github_client_id_here
Replace your_github_client_id_here
with the Client ID you obtained from GitHub.
python app.py
If you wish to build an executable file for distribution, you can use PyInstaller:
you can install PyInstaller using pip:
pip install --force-reinstall --no-binary :all: pyinstaller
Then, run the following command:
pyinstaller --noconfirm --onefile --windowed --icon=assets\app_logo.ico --add-data "assets;assets" --add-data ".env;." --hidden-import "keyring.backends.Windows" --collect-all "keyring" --exclude-module "tkinter" --exclude-module "test" --name "EasyGitSwitcher" app.py
This will create a standalone executable in the dist
directory.
Once the application is running, you can:
- Add a GitHub Account:
- Click on "Add GitHub Account".
- A dialog will appear with a user code and a link to GitHub's authorization page.
- Copy the user code and open the authorization page.
- Paste the user code when prompted and authorize the application.
- The application will automatically detect when the authorization is complete.
- Switch Profiles:
- Select a profile from the list.
- Click "Switch Profile" to make it the current Git profile.
- Edit Profiles:
- Select a profile and click "Edit Profile" to modify its name, email, or tag.
- Delete Profiles:
- Select a profile and click "Delete Selected Profile" to remove it.
- Python Version: Ensure you have Python 3.10.14 or higher installed.
- pip Version: Ensure you have pip 24.2 or higher. You can upgrade pip using:
python -m pip install --upgrade pip
- Environment Variables: Make sure the
.env
file is correctly set up with yourCLIENT_ID
. - Dependencies: All required dependencies are listed in
requirements.txt
. Ensure they are installed.
Contributions are welcome! Please open an issue or submit a pull request for any bugs or feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: Currently, Easy Git Switcher is available for Windows. Support for Linux and macOS is coming soon.