GitShift


A powerful VS Code extension that helps developers seamlessly switch between multiple GitHub accounts for commits and pushes. Never commit with the wrong identity again!
Features
- GitHub Authentication: Sign in with real GitHub accounts using VS Code's built-in authentication for full push/pull access
- Beautiful Sidebar Panel: Dedicated Activity Bar view with minimalist dark theme and intuitive UI
- Rich Account Manager: Full-featured webview manager with add/edit/delete capabilities
- One-Click Account Switching: Switch between multiple GitHub accounts instantly
- Status Bar Integration: Always see your current Git identity at a glance
- Smart Auto-Detection: Automatically detects and displays your current Git configuration
- Automatic Credential Management: Configures git credentials automatically when using authenticated accounts
- Workspace-Specific Configuration: Git configuration is set per workspace, keeping your projects organized
- Repository Management: Built-in repository viewer with changes, branches, and commits
- Contributions Graph: Visualize your GitHub contributions calendar
- GitHub Notifications: View and manage your GitHub notifications
- Quick Clone: Clone repositories and automatically switch to the appropriate account
- Secure Token Storage: Uses VS Code's secure secret storage for all tokens

Installation
From VS Code Marketplace (Recommended)
- Open VS Code
- Press
Ctrl+Shift+X (or Cmd+Shift+X on Mac) to open Extensions
- Search for "GitShift"
- Click Install
Or install via command line:
code --install-extension mikeeeyy04.gitshift
From VSIX File
- Download the
.vsix file from the Releases page
- In VS Code, go to Extensions view (
Ctrl+Shift+X)
- Click the
... menu (top right)
- Select "Install from VSIX..."
- Navigate to and select the downloaded
.vsix file
Quick Start
Method 1: Sign In with GitHub (Recommended)
- Open a Git repository in VS Code
- Click the GitShift icon in the Activity Bar (left sidebar)
- Click "Sign In with GitHub"
- Authorize VS Code when prompted
- Your account is added automatically with full authentication!
- Switch to it and start pushing immediately 🚀
Method 2: Manual Setup with Personal Access Token
- Create a GitHub Personal Access Token with
repo, user:email, and read:user scopes
- Open a Git repository in VS Code
- Click the GitShift icon in the Activity Bar
- Click "Add/Replace GitHub Token"
- Paste your token
- Your account is automatically added and ready to use!
Method 3: Manual Configuration File
- Open a Git repository in VS Code
- Create a
.vscode/github-accounts.json file in your workspace root
- Add your GitHub accounts:
[
{
"label": "Work Account",
"name": "John Doe (Work)",
"email": "john.doe@company.com"
},
{
"label": "Personal Account",
"name": "John Doe",
"email": "john.personal@gmail.com"
}
]
Usage
Switching Accounts
Method 1: Sidebar Panel (Recommended)
- Click the GitShift icon in the Activity Bar
- Click on any account in the list to switch instantly
- Current account is highlighted with a checkmark
Method 2: Command Palette
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "GitHub: Switch Account"
- Select your desired account from the list
Method 3: Status Bar
- Click on the account name in the status bar (bottom left)
- Select your desired account from the list
Viewing Current Account
- Sidebar: Open the GitShift sidebar to see the current account highlighted
- Status Bar: Your current account is always displayed in the status bar
- Command: Run "GitHub: Show Active Account" from the Command Palette
Managing Accounts
- Add Account: Click "Sign In with GitHub" or "Add/Replace GitHub Token"
- Delete Account: Click the trash icon next to an account in the sidebar
- Edit Account: Edit the
.vscode/github-accounts.json file directly
Configuration
Account Structure
Each account in .vscode/github-accounts.json must have:
label (required): Display name shown in the picker (e.g., "Work Account")
name (required): Full name for git commits (e.g., "John Doe (Work)")
email (required): Email address for git commits (e.g., "john.doe@company.com")
username (optional): GitHub username (added automatically when signing in)
authenticated (optional): Whether the account has authentication enabled
Example Configuration
[
{
"label": "Work Account",
"name": "Alice Smith",
"email": "alice@company.com",
"username": "alice-company",
"authenticated": true
},
{
"label": "Personal Account",
"name": "Alice Smith",
"email": "alice@personal.com",
"username": "alice-personal",
"authenticated": true
},
{
"label": "Open Source",
"name": "Alice Smith (OSS)",
"email": "alice@opensource.dev"
}
]
Workspace vs Global
- Workspace Configuration: Accounts in
.vscode/github-accounts.json are workspace-specific
- Global Tokens: GitHub tokens are stored securely and accessible across all workspaces
- Auto-Import: The extension automatically imports tokens from other workspaces
Commands
This extension provides the following commands (accessible via Ctrl+Shift+P). Search for "GitShift" to see all commands:
Account Management
GitShift: Sign In with GitHub - Sign in with a real GitHub account (full authentication)
GitShift: Switch Account - Opens the account picker to switch accounts
GitShift: Show Active Account - Displays your current Git identity
GitShift: Import Active Session from VS Code - Import existing GitHub sessions
GitShift: Add/Replace GitHub Token - Add or replace a Personal Access Token
GitShift: Remove GitHub Token - Remove token from an account
GitShift: Link to GitHub - Link an existing manual account to GitHub authentication
GitShift: Open Configuration File - Opens the .vscode/github-accounts.json file
Repository Operations
GitShift: Repository Quick Clone & Switch - Clone a repository and switch to appropriate account
GitShift: Clone Repository... - Clone a Git repository
GitShift: Initialize Repository - Initialize a new Git repository in the current workspace
Git Operations
GitShift: Pull - Pull changes from remote
GitShift: Push - Push changes to remote
GitShift: Sync - Sync with remote (fetch + merge)
GitShift: Fetch - Fetch changes from remote
GitShift: Pull (Rebase) - Pull with rebase
GitShift: Push (Force) - Force push to remote (use with caution)
GitShift: Checkout to... - Switch to a different branch
GitShift: Create Branch... - Create a new branch
GitShift: Delete Branch... - Delete a branch
GitShift: Merge Branch... - Merge a branch into current branch
GitShift: Rebase Branch... - Rebase current branch onto another branch
GitShift: Stash Changes - Stash current changes
GitShift: Pop Stash - Apply the most recent stash
GitShift: View Stashes - View all stashes
GitShift: Discard All Changes - Discard all uncommitted changes
GitShift: Amend Last Commit - Amend the last commit
GitShift: Undo Last Commit - Undo the last commit (keeps changes staged)
Remote Management
GitShift: Add Remote... - Add a new remote repository
GitShift: Remove Remote... - Remove a remote repository
GitShift: View Remotes - View all configured remotes
UI & Views
GitShift: Refresh Sidebar - Refresh the GitShift sidebar
GitShift: Refresh - Refresh the current view
GitShift: More Actions... - Show additional Git operations menu
GitShift: Open GitHub Profile - Open your current account's GitHub profile in browser
GitShift: Refresh Contributions - Refresh the contributions graph
GitShift: Show Git Output - Show Git command output channel
UI Overview
- Activity Bar Icon: Click the account icon in the left sidebar
- Account List: See all your accounts with visual indicators
- Current Account: Highlighted with a checkmark and badge
- Quick Actions: Switch, add, or delete accounts directly from the sidebar
Repository View
- Changes Tab: View staged and unstaged changes
- Branches Tab: See all local and remote branches
- Commits Tab: Browse recent commit history
- Quick Actions: Pull, push, sync, and more Git operations
Contributions View
- GitHub Contributions Graph: Visualize your contribution calendar
- Profile Information: See your GitHub profile and stats
- Public & Private Repos: View contributions from both (with proper scopes)
How It Works
Authenticated Accounts
When you sign in with GitHub, the extension:
- Uses VS Code's built-in GitHub authentication provider
- Fetches your GitHub username, email, and profile information
- Stores the access token securely using VS Code's Secret Storage API
- Configures git credentials automatically for push/pull operations
- Sets your git user.name and user.email for the current workspace
- You can push/pull immediately without additional setup!
Manual Accounts
For manual accounts, the extension sets:
git config user.name "Your Name"
git config user.email "your.email@example.com"
These settings are stored in .git/config in your workspace and only affect the current repository. Your global Git configuration remains unchanged.
Note: Manual accounts only set the commit author. You'll need SSH keys or Personal Access Tokens configured separately for authentication.
Auto-Activation
The extension automatically:
- Activates the first available account when opening a workspace
- Selects an account with repository access when possible
- Validates token authenticity on startup
- Syncs account information across workspaces
Requirements
- VS Code: Version 1.90.0 or higher
- Git: Must be installed and accessible from the command line
- Internet Connection: Required for GitHub authentication and API calls
- GitHub Account: Required for authenticated features
Troubleshooting
"Not in a Git repository" error
Make sure you have a Git repository initialized in your workspace:
git init
Accounts not showing up
- Verify
.vscode/github-accounts.json exists in your workspace root
- Check that the JSON is valid (use a JSON validator)
- Ensure each account has
label, name, and email fields
- Try refreshing the sidebar or reloading the window (
Ctrl+R or Cmd+R)
Status bar not updating
- Try running the "GitHub: Show Active Account" command
- Reload the VS Code window (
Ctrl+R or Cmd+R)
- Check if you're in a Git repository
Git commands failing
- Verify Git is installed:
git --version
- Ensure Git is in your system PATH
- Check workspace folder permissions
- For authenticated accounts, verify your token has the correct scopes (
repo, user:email, read:user)
Token authentication issues
- Verify your token has the required scopes:
repo - Full control of private repositories
user:email - Access user email addresses
read:user - Read user profile data
notifications - Access notifications (optional)
- Try removing and re-adding the token
- Check if the token has expired
Extension not activating
- Check VS Code version (requires 1.90.0+)
- Open the Output panel and select "GitShift" from the dropdown
- Check for error messages
- Reload the window:
Ctrl+R (or Cmd+R on Mac)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
We have a comprehensive Contributing Guide that covers:
- How to set up your development environment
- Coding standards and best practices
- How to submit bug reports and feature requests
- The pull request process
Quick Start:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Make your changes and test them
- Commit your changes following our commit guidelines
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
Please read CONTRIBUTING.md for complete details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License allows commercial use, modification, and distribution. Please maintain proper attribution when using this code. See LICENSE for full details.
Support the Project
If you find GitShift helpful and want to support its development, consider buying me a coffee!
Your support helps keep this project maintained and improved! 💖
Feedback & Issues
Found a bug or have a feature request? Please open an issue on GitHub.
Credits
Developed to solve the common problem of managing multiple GitHub identities in VS Code.
Enjoy seamless GitHub account switching! 🚀

Made with ❤️ for the developer community