Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Git plugin: create branch if it does not exist
Browse files Browse the repository at this point in the history
Note that if a local branch with the same name already exist, it will be
reset to the current HEAD.
  • Loading branch information
easybe committed Jun 1, 2021
1 parent 424086a commit c7a372e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AU/Plugins/Git.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ if ($User -and $Password) {
Add-Content "$env:USERPROFILE\.git-credentials" "https://${Password}:x-oauth-basic@$machine`n"
}

Write-Host "Checking out & resetting $Branch branch"
git checkout -q -B $Branch

Write-Host "Executing git pull"
git checkout -q $Branch
git pull -q origin $Branch

$gitAddArgs = @()
Expand Down Expand Up @@ -92,7 +94,7 @@ else {

}
Write-Host "Pushing changes"
git push -q
git push -q origin $Branch
if ($commitStrategy -eq 'atomictag') {
write-host 'Atomic Tag Push'
git push -q --tags
Expand Down

0 comments on commit c7a372e

Please sign in to comment.