1
0
mirror of https://github.com/fleschutz/PowerShell.git synced 2025-03-26 14:26:10 +01:00

Renamed to configure-git.ps1

This commit is contained in:
Markus Fleschutz 2020-12-02 07:27:07 +00:00
parent f071a14129
commit dd14dba22d
2 changed files with 6 additions and 4 deletions

View File

@ -8,10 +8,10 @@ List of Scripts
The following PowerShell scripts can be found in the `Scripts/` subfolder:
* [clone-repos.ps1](Scripts/clone-repos.ps1) - clones well-known Git repositories
* [configure-git.ps1](Scripts/configure-git.ps1) - sets up the Git configuration
* [download.ps1](Scripts/download.ps1) - downloads the file/directory from the given URL
* [empty-dir.ps1](Scripts/empty-dir.ps1) - empties the given directory
* [exe_info.ps1](Scripts/exe_info.ps1) - prints basic information of the given executable file
* [init-git.ps1](Scripts/init-git.ps1) - initializes the Git configuration
* [latlong.ps1](Scripts/latlong.ps1) - prints the lat/long coordinates of the given city
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders in a directory tree
* [list-unused-files.ps1](Scripts/list-unused-files.ps1) - lists unused files in a directory tree

View File

@ -1,19 +1,21 @@
#!/snap/bin/powershell
# Syntax: ./init-git.ps1
# Description: initializes the Git configuration
# Syntax: ./configure-git.ps1
# Description: sets up the Git configuration
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
# NOTE: requires installation of Git
$UserName = read-host "Enter your full name"
$UserEmail = read-host "Enter your email address"
$UserEditor = read-host "Enter your favorite editor (nano, vi, emacs)"
$UserEditor = read-host "Enter your favorite editor (nano, vi, emacs, ...)"
try {
git config --global user.name $UserName
git config --global user.email $UserEmail
git config --global core.editor $UserEditor
git config --global init.defaultBranch main
echo "Done."
exit 0
} catch { Write-Error $Error[0] }