Pull Request mode
A Finish option for repositories where master and develop are protected: instead of merging locally, the extension pushes the branch and opens the pull requests. Review and merge stay in human hands.
When to use it
| Local merge (default) | Pull Request (option) | |
|---|---|---|
| Branches protected on the server | Push refused | ✅ Designed for it |
| Code review | — | ✅ On the platform |
| Speed | ✅ Immediate | After the PR is approved |
| Remote required | No (or any remote) | GitHub or Azure DevOps |
You choose at each Finish in the Finish dialog. To pre-select Pull Request on a repository, set "Default Finish mode" in the settings.
Requirements
- The
originremote points to GitHub (github.com) or Azure DevOps (dev.azure.comor*.visualstudio.com), over https or ssh. - Git already knows your credentials: if you have already pushed or fetched over https on this server (from Visual Studio or a terminal), that is the case. The extension asks git for them (
git credential fill, in practice the Git Credential Manager). It stores none, and they never appear in the logs. - No extra tool: no
gh, noaz.
Sign in once by running git ls-remote <repository url> in a terminal: the Git Credential Manager sign-in window opens. Then try again.
A feature through a PR
- Start and develop the feature as usual (guide).
- Finish…: choose Pull Request. The push and delete-on-origin options disappear: they are not used in PR mode.
- The next screen shows the generated title and description for each PR, editable.
- OK: the extension pushes the branch, then creates the PR feature/x → develop. If one is already open, it is reused and your new commits go into it. Nothing is merged locally.
- Get it reviewed and merge the PR on the platform (preferably without fast-forward, see squash).
- In the GitFlow window: Refresh PRs, then Complete branch.
The generated message
Built from git only (deterministic, no AI). The title follows the convention Feature: name / Release 1.5.0 / Hotfix 1.5.1. The description:
**Feature** `feature/ABC-12-login` → `develop`
### Commits (2)
- Add the login page
- Fix the button style (#42)
### Files
5 file(s) changed, 120 line(s) added, 8 line(s) deleted
### Tickets
ABC-12, #42
For a release or a hotfix, a Version section reminds you of the tag that will be created after the merge.
Customizing
- Your template:
.gitflow/pull_request_template.mdin the repository, with the variables{type}{source}{target}{commits}{stats}{version}{tickets}. - The platform template (
.github/pull_request_template.md,.azuredevops/pull_request_template.md…) is used as a base: the generated description is added below it. - Ticket pattern: the
gitflowvs.pr.ticketpatternkey (regular expression). DefaultABC-123and#42.
Tracking PRs
A Pull requests section appears in the window as soon as a PR is tracked: one row per PR, with its state (open, merged, closed without merge) and an Open button for the browser.
The state is read from the platform at most once a minute while the window is visible, or immediately with Refresh PRs.
The extension never approves or merges a PR.
Release and hotfix: the tag
A release opens two PRs: to master and to develop. So does a hotfix, to master then to develop (or to the release in progress).
The tag can only be created once the PR to master is merged, on its merge commit:
- Merge the PR to master on the platform.
- Refresh PRs: the Create tag 1.5.0 button appears.
- The extension fetches master, checks that the merge commit is on
origin/master, creates the annotated tag (with the message entered at Finish) and pushes it.
Complete branch also creates the tag if it is missing, when both PRs are already merged.
Complete branch
When all the PRs of a branch are merged, Complete branch:
- creates the tag if it is a release or a hotfix and the tag is missing;
- runs
git fetch(orgit fetch --pruneif the option is checked in the settings); - updates your local
develop/master, fast-forward only; - deletes the local branch with
git branch -dand forgets its PRs; - leaves you on develop (or on the release in progress).
In that case, the commits of your branch are not in develop: the extension detects it and does not delete the branch. Delete it yourself if you are sure. To avoid this, choose a regular merge (Merge / Merge (no fast-forward)).
Complete does not delete the branch on the server: check Delete branch after merging (Azure) or enable Automatically delete head branches (GitHub). With the git fetch --prune option, the matching origin/… references then disappear from your machine on their own.
GitHub and Azure DevOps
| GitHub | Azure DevOps | |
|---|---|---|
| Remote URL | https://github.com/org/repo.gitgit@github.com:org/repo.git | https://dev.azure.com/org/project/_git/repogit@ssh.dev.azure.com:v3/org/project/repohttps://org.visualstudio.com/project/_git/repo |
| Credentials | git's credentials for github.com | git's credentials for dev.azure.com (Microsoft account or personal access token) |
| Protected branches | Branch protection rules | Branch policies |
| Delete the branch after merge | Delete branch on the PR, or repository setting | Delete … after merging checkbox on Complete |
With an ssh remote, the extension still asks the Git Credential Manager for https credentials to call the API: sign in once over https if needed.
Company Azure DevOps server
The URLs of an Azure DevOps server installed in a company (Azure DevOps Server, formerly TFS) cannot be recognised automatically, for example https://tfs.company.com/tfs/Collection/Project/_git/Repo. In that case, check "Pull Request: origin is an Azure DevOps server" in the settings.
- The URL must contain
/_git/: the API is called on the part before it (collection and project). - Authentication: the credentials git knows for this server (personal access token) if there are any, otherwise your Windows session, like git itself inside a company network.
- REST API 4.1: works from TFS 2018 on.
- With an ssh remote, the API is called over https on the same server.