forked from LondheShubham153/retail-store-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpush-to-github.ps1
More file actions
40 lines (33 loc) · 1.28 KB
/
push-to-github.ps1
File metadata and controls
40 lines (33 loc) · 1.28 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
34
35
36
37
38
39
40
# Push Changes to GitHub
Write-Host "Pushing changes to GitHub..." -ForegroundColor Green
Write-Host ""
# Check current branch
$branch = git branch --show-current
Write-Host "Current branch: $branch" -ForegroundColor Cyan
# Add all changes
Write-Host "Adding files..." -ForegroundColor Yellow
git add .
# Show status
Write-Host ""
Write-Host "Files to be committed:" -ForegroundColor Yellow
git status --short
# Commit
Write-Host ""
$commitMessage = Read-Host "Enter commit message (or press Enter for default)"
if ([string]::IsNullOrWhiteSpace($commitMessage)) {
$commitMessage = "Add monitoring stack and access documentation"
}
Write-Host "Committing with message: $commitMessage" -ForegroundColor Yellow
git commit -m "$commitMessage"
# Push
Write-Host ""
Write-Host "Pushing to origin/$branch..." -ForegroundColor Yellow
git push origin $branch
Write-Host ""
Write-Host "==================================================" -ForegroundColor Green
Write-Host "Successfully pushed to GitHub!" -ForegroundColor Green
Write-Host "==================================================" -ForegroundColor Green
Write-Host ""
Write-Host "View your changes at:" -ForegroundColor Cyan
Write-Host "https://github.com/bashairfan0911/retail-store-sample-app/tree/$branch" -ForegroundColor White
Write-Host ""