Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
git config --global ""
git config --global "Azure DevOps"
EXTRAHEADER="Authorization: Bearer $(System.AccessToken)"
git -c http.extraheader="$EXTRAHEADER" clone $REPO
cd $(Build.Repository.Name)
MAINBRANCHNAME=$(git rev-parse --abbrev-ref HEAD)
git config http.$REPO.extraHeader "$EXTRAHEADER"
echo -- Merge $(Build.SourceBranchName) to $MAINBRANCHNAME --
git fetch origin $(Build.SourceBranchName) --prune
git merge origin/$(Build.SourceBranchName) -m "merge $(Build.SourceBranchName) to $MAINBRANCHNAME" --no-ff
echo -- Create tag named $TAGNAME --
git tag -a -m "$(Build.SourceBranchName) installed to production" $TAGNAME
git push origin $MAINBRANCHNAME
git push origin --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment