
How to Set Up Git Version Control in GoLand
To set up version control in GoLand, install Git, point GoLand at it in Settings | Version Control | Git, then either clone a repository with Git | Clone or turn an existing project into a repository with VCS | Enable Version Control Integration and choose Git. From there you commit with Ctrl+K, push with Ctrl+Shift+K and manage branches from the branch widget in the window header. The menu paths below match GoLand 2026.2, the current release as of October 2026 (GoLand Git docs).
macOS users: replace Ctrl with Cmd in the shortcuts, and open settings with GoLand | Settings (Cmd+,) instead of File | Settings (Ctrl+Alt+S).
Step 1: Install Git and connect it to GoLand
GoLand's Git integration is a bundled plugin, but it calls the real git binary.
- Install Git from git-scm.com (on macOS,
xcode-select --installor Homebrew also works). - Set your identity once, in a terminal:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
- In GoLand open Settings | Version Control | Git. In Path to Git executable, leave the detected path or browse to it, then click Test. GoLand should report the Git version.
On Windows, if Git isn't installed natively, GoLand will look for Git inside WSL2 and use that. Projects opened from a \\wsl$ path automatically use WSL's Git (settings reference).
Step 2: Get a project under version control
Pick the case that matches you.
A. Clone an existing repository
- On the Welcome screen click Clone Repository, or with a project open use Git | Clone. If there's no Git menu yet, it's VCS | Get from Version Control (also File | New | Project from Version Control).
- Paste the repository URL (HTTPS or SSH), or pick GitHub on the left to browse your own repositories after signing in.
- Choose the Directory and click Clone. Confirm that you want to open it as a project.
For huge repositories, the GitHub tab offers Shallow clone with a history truncated to N commits; fetch the rest later with Git | Unshallow Repository (GitHub projects docs).
B. Put an existing local project under Git
- Open the project.
- Choose VCS | Enable Version Control Integration (or press **Alt+
** for the VCS Operations popup), select **Git** and click **OK**. GoLand runsgit init` in the project root. - GoLand asks whether to share project settings files (
.idea) through VCS. Most Go teams say no; if you do share them, commit only the shared files and ignoreworkspace.xml.
To create a repository for just a subdirectory, use VCS | Create Git Repository and choose that folder.
If you open a project that already contains a .git folder, GoLand detects it. If it finds nested repositories it isn't tracking, a notification offers Add roots; you can also manage this in Settings | Version Control | Directory Mappings (VCS integration docs).
Step 3: Add a .gitignore before your first commit
New files show up under Unversioned Files in the Commit tool window (Alt+0). Before adding them, create a .gitignore in the project root. A sensible start for Go:
# Binaries and build output
/bin/
/dist/
*.exe
*.test
*.out
# Coverage
coverage.*
# Local env and IDE
.env
.idea/workspace.xml
.idea/shelf/
Commit go.mod and go.sum. Don't commit vendor/ unless your team deliberately vendors dependencies.
To ignore a file you already see in the IDE, right-click it under Unversioned Files and choose Git | Add to .gitignore (shared with the team) or Git | Add to .git/info/exclude (only on your machine).
Step 4: Commit your changes
- Open the Commit tool window with Ctrl+K (or Alt+0).
- Select the files to include. To add new files, select them under Unversioned Files and press Ctrl+Alt+A (Add to VCS).
- Write a commit message.
- Click Commit, or Commit and Push (Ctrl+Alt+K).
Useful options in the commit panel (commit docs):
- Commit checks (gear icon or Ctrl+O): run Go fmt, reformat code and optimize imports before committing. Turning on Go fmt here is the easiest way to keep unformatted Go out of the repo. Under Advanced Commit Checks you can also analyze code, check TODOs or run a run configuration (for example your tests).
- Amend: tick it to fold the change into the last commit.
- Partial commits: press Ctrl+D to open the diff and tick only the chunks you want. Right-click a line and choose Split Chunks and Include Selected Lines into Commit for single lines.
Changelists or staging area?
By default GoLand uses changelists instead of Git's index: modified files are staged automatically when you commit. If you prefer git add semantics, enable Settings | Version Control | Git | Enable staging area. You then stage files with Ctrl+Alt+A or stage individual chunks from the gutter marker in the editor. Enabling it deletes existing changelists, so commit or shelve first.
Step 5: Connect a remote and push
Existing GitHub account, new repository:
- Choose Git | GitHub | Share Project on GitHub (or VCS | Share Project on GitHub if version control isn't enabled yet).
- Sign in when asked, either Log In via GitHub in the browser or Use token with a personal access token.
- Enter the repository name, remote name (default
origin), description, and tick Private if needed. Click Share. GoLand creates the repository, adds the remote and pushes.
Any other host (GitLab, Bitbucket, self-hosted):
- Create an empty repository on the host.
- Press Ctrl+Shift+K (Git | Push). With no remote configured, click Define remote and paste the URL. Add more remotes later in Git | Manage Remotes.
- Click Push. The drop-down next to it offers Force push for rewritten history; protected branches block it.
To avoid typing passwords, use SSH keys, or let GoLand remember credentials in Settings | Appearance & Behavior | System Settings | Passwords.
Step 6: Daily work: pull, branches, merges and conflicts
- Pull or update: Git | Pull, or Git | Update Project (Ctrl+T) to fetch and merge or rebase all roots at once.
- Branches: click the branch name widget in the window header. From there choose New Branch, check out a branch, or right-click a branch for merge, rebase, compare and delete. The widget shows incoming (blue) and outgoing (green) commit counts (branches docs).
- Merge with options: Git | Merge lets you add
--no-ff,--squash,--ff-onlyand similar flags. - History: the Git tool window (Alt+9) has the Log tab, where you can filter by branch, user and path, cherry-pick a commit or create a branch from it.
- Conflicts: when a pull, merge, rebase, cherry-pick or unstash conflicts, the Conflicts dialog offers Accept Yours, Accept Theirs or Merge. Merge opens a three-pane editor: your version on the left, theirs on the right, the result in the middle. Start with Apply All Non-Conflicting Changes, then resolve what's left (conflict docs).
- Annotate (blame): right-click the gutter and choose Annotate with Git Blame.
Shortcut cheat sheet (Windows/Linux default keymap)
| Action | Shortcut | Menu |
|---|---|---|
| VCS operations popup | Alt+` | VCS |
| Commit | Ctrl+K | Git, Commit |
| Commit and push | Ctrl+Alt+K | Commit panel |
| Push | Ctrl+Shift+K | Git, Push |
| Update project | Ctrl+T | Git, Update Project |
| Add file to VCS / stage | Ctrl+Alt+A | Git, Add |
| Commit tool window | Alt+0 | View, Tool Windows |
| Git tool window (Log) | Alt+9 | View, Tool Windows |
Troubleshooting
- "Cannot run program git": the path in Settings | Version Control | Git is wrong or Git isn't installed. Fix it and click Test.
- Files show red but you never added them: they're unversioned. Add them, or ignore them via
.gitignore. - CRLF warnings on Windows: GoLand warns before committing CRLF line endings and suggests a
core.autocrlfvalue. For Go projects,git config --global core.autocrlf inputplus LF in the editor is a safe default. - Push rejected: someone pushed first. Pull (merge or rebase), resolve conflicts, then push again. You can tell GoLand to update automatically in the Git settings page.
New to Git itself? Read our version control for beginners guide first. And if you're choosing an editor, browse IDEs on DevHunt and AI coding tools that plug into JetBrains IDEs.
FAQ
How do I enable version control in GoLand?
Open the project and choose VCS | Enable Version Control Integration, select Git, and click OK. GoLand initializes a repository in the project root, and the VCS menu becomes a Git menu.
Does GoLand include Git?
No. The Git integration is built in, but you need Git installed on your system. On Windows, GoLand can use Git from WSL2 if no Windows Git is installed.
How do I connect GoLand to GitHub?
Use Git | GitHub | Share Project on GitHub to create a new GitHub repository from a local project, or Git | Clone and the GitHub tab to clone one. GoLand signs in via the browser or a personal access token.
Can I use the Git staging area in GoLand?
Yes. Enable Settings | Version Control | Git | Enable staging area. Without it, GoLand uses changelists and stages changes automatically when you commit.
How do I change the remote URL in GoLand?
Open Git | Manage Remotes, select the remote (usually origin), edit its URL and click OK. It's the same as running git remote set-url origin <url>.