40 lines
1.2 KiB
PowerShell
40 lines
1.2 KiB
PowerShell
# Setup Git repository and push to Gitea
|
|
$gitPath = "C:\Program Files\Git\cmd\git.exe"
|
|
|
|
# Configure git user (if not already configured)
|
|
& $gitPath config --global user.name "kyle"
|
|
& $gitPath config --global user.email "t72chevy@hotmail.com"
|
|
|
|
# Initialize git repository
|
|
Write-Host "Initializing git repository..."
|
|
& $gitPath init
|
|
|
|
# Add remote
|
|
Write-Host "Adding Gitea remote..."
|
|
& $gitPath remote add origin "http://192.168.68.53:3000/kyle/SignageHTML.git"
|
|
|
|
# Configure remote URL with token for authentication
|
|
$remoteUrl = "http://kyle:9ed750a7f1480481ff96f021c8bbf49836b902f8@192.168.68.53:3000/kyle/SignageHTML.git"
|
|
& $gitPath remote set-url origin $remoteUrl
|
|
|
|
# Add all files
|
|
Write-Host "Adding files..."
|
|
& $gitPath add .
|
|
|
|
# Create initial commit
|
|
Write-Host "Creating initial commit..."
|
|
& $gitPath commit -m "Initial commit: Digital signage system for transit departures, weather, and news ticker"
|
|
|
|
# Push to Gitea
|
|
Write-Host "Pushing to Gitea..."
|
|
& $gitPath push -u origin main
|
|
|
|
# If main branch doesn't exist, try master
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Trying master branch..."
|
|
& $gitPath branch -M master
|
|
& $gitPath push -u origin master
|
|
}
|
|
|
|
Write-Host "Done! Repository is now on Gitea at http://192.168.68.53:3000/kyle/SignageHTML"
|