An Electron application to easily switch between multiple Git profiles.
By Ahmet YILDIZ | phosimurg
- Add, delete, edit, and activate profiles
- View the currently active profile
- Manage Git config settings easily
- Automatically create a profile on first launch
- Detect external Git config changes and offer to save them
When you launch the application for the first time, it will automatically create a profile by reading the username and email from your local Git config.
How to Test:
- Clear the application data (usually located at
%APPDATA%/git-profile-manager). - Ensure your Git configuration (
git config) has a username and email set. - Launch the application.
- A profile should be created automatically.
If the Git config is changed outside the application, Git Profile Manager will detect it and notify you.
How to Test:
- Start the application.
- Open another terminal or command prompt.
- Run the following commands:
git config --global user.name "New Name" git config --global user.email "new@email.com"
- Within 10 seconds, the application will detect the changes and show a notification.
- You can click "Save as Profile" or ignore the changes.
npm install# This command will start the React server and then launch the Electron app
npm run electron:devnpm run electron:buildgit-profile-manager/
├── electron/
│ ├── main.js # Electron main process
│ └── preload.js # Preload script for API communication
├── public/ # React static files
├── src/
│ ├── components/ # React components
│ │ ├── ActiveProfile.js
│ │ ├── ProfileForm.js
│ │ └── ProfileList.js
│ ├── App.js # Main app component
│ └── index.js # React entry point
└── package.json # Project dependencies and scripts
- Install the required npm packages:
npm install wait-on concurrently electron electron-is-dev --save-dev- Start the application:
npm run electron:devIf you encounter React Hook errors, it might be caused by multiple versions of React being included. Follow these steps:
rm -rf node_modules
rm package-lock.json
npm install
npm run electron:dev- Check for error messages in the terminal.
- Make sure the React development server (usually running at
localhost:3000) is active. - Ensure the preload script (
preload.js) is correctly loaded. - If you encounter CSP (Content Security Policy) errors, you can temporarily disable web security during development by updating the
package.jsonscript:
"electron:start": "wait-on http://localhost:3000 && electron --disable-web-security ."