mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-29 16:16:47 +01:00
Renamed to configure-git.ps1
This commit is contained in:
parent
f071a14129
commit
dd14dba22d
@ -8,10 +8,10 @@ List of Scripts
|
|||||||
The following PowerShell scripts can be found in the `Scripts/` subfolder:
|
The following PowerShell scripts can be found in the `Scripts/` subfolder:
|
||||||
|
|
||||||
* [clone-repos.ps1](Scripts/clone-repos.ps1) - clones well-known Git repositories
|
* [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
|
* [download.ps1](Scripts/download.ps1) - downloads the file/directory from the given URL
|
||||||
* [empty-dir.ps1](Scripts/empty-dir.ps1) - empties the given directory
|
* [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
|
* [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
|
* [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-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
|
* [list-unused-files.ps1](Scripts/list-unused-files.ps1) - lists unused files in a directory tree
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./init-git.ps1
|
# Syntax: ./configure-git.ps1
|
||||||
# Description: initializes the Git configuration
|
# Description: sets up the Git configuration
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
|
# NOTE: requires installation of Git
|
||||||
|
|
||||||
$UserName = read-host "Enter your full name"
|
$UserName = read-host "Enter your full name"
|
||||||
$UserEmail = read-host "Enter your email address"
|
$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 {
|
try {
|
||||||
git config --global user.name $UserName
|
git config --global user.name $UserName
|
||||||
git config --global user.email $UserEmail
|
git config --global user.email $UserEmail
|
||||||
git config --global core.editor $UserEditor
|
git config --global core.editor $UserEditor
|
||||||
|
git config --global init.defaultBranch main
|
||||||
echo "Done."
|
echo "Done."
|
||||||
exit 0
|
exit 0
|
||||||
} catch { Write-Error $Error[0] }
|
} catch { Write-Error $Error[0] }
|
Loading…
Reference in New Issue
Block a user