Azure DevOps
plugin for Oh My Fish and Fisher,
omf install https://github.com/Asim-Tahir/azure-devops.fish
fisher install Asim-Tahir/azure-devops.fish
After installing the azure-devops.fish
plugin, can use the functions with the following command:
The azure-devops.pr-url
function helps you quickly get the URL of your Azure DevOps pull request. It works in any git repository connected to Azure DevOps.
azure-devops.pr-url
# Output: https://dev.azure.com/organization/project/_git/repository/pullrequestcreate?sourceRef=feature-branch&targetRef=main
Display help information:
azure-devops.pr-url --help
# or
azure-devops.pr-url -h
Specify the Git remote name:
azure-devops.pr-url --git-remote "upstream"
# or
azure-devops.pr-url -r "origin"
Default: $AZURE_DEVOPS_FISH_GIT_REMOTE
or "origin"
Provide the Azure DevOps repository URL directly:
azure-devops.pr-url --git-remote-url "https://dev.azure.com/MyOrg/MyProject/_git/MyRepo"
# or
azure-devops.pr-url -R "[email protected]:v3/MyOrg/MyProject/MyRepo"
Default: $AZURE_DEVOPS_FISH_GIT_REMOTE_URL
or URL from specified git remote
Set the source branch for the PR:
azure-devops.pr-url --source-branch "feature/new-feature"
# or
azure-devops.pr-url -s "bugfix/issue-123"
Default: $AZURE_DEVOPS_FISH_SOURCE_BRANCH
or current branch
Set the target branch for the PR:
azure-devops.pr-url --target-branch "main"
# or
azure-devops.pr-url -t "develop"
Default: $AZURE_DEVOPS_FISH_TARGET_BRANCH
or git default branch
- Basic usage with default values:
azure-devops.pr-url
- Specify target branch only:
azure-devops.pr-url -t "main"
- Custom source and target branches:
azure-devops.pr-url -s "feature/my-awesome-feature" -t "develop"
- Using different git remote with target branch:
azure-devops.pr-url -r "upstream" -t "main"
- Full example with all arguments:
azure-devops.pr-url \
-s "feature/my-awesome-feature" \
-t "main" \
-R "https://[email protected]/My_Org/My%20-%20Project/_git/My.Repo"
AZURE_DEVOPS_FISH_GIT_REMOTE
: Git remote nameAZURE_DEVOPS_FISH_GIT_REMOTE_URL
: Git remote URLAZURE_DEVOPS_FISH_SOURCE_BRANCH
: Source branchAZURE_DEVOPS_FISH_TARGET_BRANCH
: Target branch
AZURE_DEVOPS_FISH_PULL_REQUEST_URL
: Azure DevOps Pull Request URL
Base structure heavily inspired from jhillyerd/plugin-git
. Thanks for the amazing plugin.