forked from mmsaeed509/Image-Processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.ps1
More file actions
59 lines (40 loc) · 1.39 KB
/
push.ps1
File metadata and controls
59 lines (40 loc) · 1.39 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Copyright (C) 2022 Mahmoud Mohamed (00xWolf) <https://github.com/mmsaeed509>
# LICENSE © GNU-GPL3
#
#
# you can run script with 2 arguments (your commit comment)
# ./push.ps1 -m "yourCommit"
#
# a simple PowerShell script to push your commits to GitHub #
Write-Host "#############################" -ForegroundColor Cyan
Write-Host "# Git Push Script #" -ForegroundColor Cyan
Write-Host "#############################" -ForegroundColor Cyan
# get branch name (e.g master, main, etc... ) #
$Branch = git branch --show-current
Write-Host "`n[*] Your Current Branch : $Branch" -ForegroundColor Red
# get new updates if it founded #
Write-Host "`n[+] Updating Repo... `n" -ForegroundColor Magenta
git pull
Write-Host "`n[+] The new changes in the repo:- `n" -ForegroundColor Magenta
git status -s
Write-Host "`n[+] Adding new changes to the repo... `n" -ForegroundColor Magenta
git add --all .
$M = "-m"
if ( "$($args[0])" -eq $M ) {
# commit changes#
Write-Host ""
git commit -m "$($args[1])"
}else {
Write-Host "##################################" -ForegroundColor Magenta
Write-Host "# Write your commit comment! :- #" -ForegroundColor Magenta
$COMMIT = Read-Host
# commit changes#
Write-Host ""
git commit -m "$COMMIT"
}
# push to repo #
Write-Host ""
git push -u origin $Branch
# D O N E! #
Write-Host "`n[✔] D O N E `n" -ForegroundColor Green"