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 4a981ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions AU/Plugins/Git.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ 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 -B $Branch

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

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

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

0 comments on commit 4a981ae

Please sign in to comment.