-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitpush.ps1
More file actions
33 lines (32 loc) · 1.2 KB
/
gitpush.ps1
File metadata and controls
33 lines (32 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Push-Master {
param(
[string]$GitRepoName,
[string]$CommitMessage,
[string]$BranchName
)
Write-Information "Make sure you are firing this from right directory" -InformationAction Continue
git add .
git pull origin master
git commit -m $CommitMessage
git push origin $BranchName
}
function Start{
param (
[string]$default
)
if(($default -like "*yeah*") -or ($default -like "*yes*")){
Push-Master -GitRepoName "MKSAutoScripts" -CommitMessage "Update fixes" -BranchName "master"
}
else{
Write-Information "Enter repo name" -InformationAction Continue
$GitRepoName = Read-Host
Write-Information "Enter Commit Message" -InformationAction Continue
$CommitMessage = Read-Host
Write-Information "Enter name of branch" -InformationAction Continue
$BranchName = Read-Host
Push-Master -GitRepoName $GitRepoName -CommitMessage $CommitMessage -BranchName $BranchName
}
}
Write-Information "your legendary style" -InformationAction Continue
$default = Read-Host
Start -default $default