-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-github.ps1
More file actions
28 lines (20 loc) · 914 Bytes
/
Copy pathsync-github.ps1
File metadata and controls
28 lines (20 loc) · 914 Bytes
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
# Скрипт для синхронизации с GitHub
# Автоматически добавляет, коммитит и пушит изменения
Write-Host "Starting GitHub sync..." -ForegroundColor Cyan
# Проверяем статус
$status = git status --porcelain
if ($status) {
Write-Host "Changes detected. Syncing..." -ForegroundColor Yellow
# Добавляем все изменения
git add .
# Создаем коммит с временной меткой
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$message = "Auto-sync: $timestamp"
git commit -m $message
# Отправляем на GitHub
git push origin master
Write-Host "Changes pushed to GitHub successfully!" -ForegroundColor Green
} else {
Write-Host "No changes to sync." -ForegroundColor Gray
}
Write-Host "Sync complete!" -ForegroundColor Cyan