forked from jrussellfreelance/powershell-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-init.ps1
More file actions
24 lines (24 loc) · 755 Bytes
/
Copy pathgit-init.ps1
File metadata and controls
24 lines (24 loc) · 755 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
# This script initializes a git repository in the folder specified, adds the files, makes the first commit, adds the remote repository, and pushes the repository.
# All you have to do is specify the full path to the folder and the url of the repository
# Grab the folder path
Do {
$path = Read-Host "Enter the path of the project"
}
While ($path -eq "")
# Grab the url of the repository
Do {
$url = Read-Host "Enter the url of the repository"
}
While ($url -eq "")
# Set the current working directory to the folder path
Set-Location $path
# Initialize an empty git repo
git init
# Add files
git add .
# Make your first commit
git commit -am "First commit!"
# Add remote origin
git remote add origin $url
# Push repository
git push -u origin master