Updated the manuals

This commit is contained in:
Markus Fleschutz
2024-11-08 12:35:11 +01:00
parent 53eb60baa3
commit 54635c32da
636 changed files with 5289 additions and 2027 deletions

View File

@ -1,12 +1,12 @@
Script: *configure-git.ps1*
========================
This PowerShell script configures the Git user settings.
This PowerShell script configures your Git user settings.
Parameters
----------
```powershell
PS> ./configure-git.ps1 [[-fullName] <String>] [[-emailAddress] <String>] [[-favoriteEditor] <String>] [<CommonParameters>]
/home/markus/Repos/PowerShell/scripts/configure-git.ps1 [[-fullName] <String>] [[-emailAddress] <String>] [[-favoriteEditor] <String>] [<CommonParameters>]
-fullName <String>
Specifies the user's full name
@ -44,12 +44,12 @@ Example
-------
```powershell
PS> ./configure-git.ps1 "Joe Doe" joe@doe.com vim
(1/6) Searching for Git executable... git version 2.42.0.windows.1
(2/6) Query user settings...
(3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)...
(4/6) Saving user settings (name,email,editor)...
(5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)...
(6/6) Listing your current settings...
(1/5) Searching for Git executable... git version 2.42.0.windows.1
(2/5) Asking for user details...
(3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)...
(4/5) Saving user settings (name,email,editor)...
(5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)...
Saved your Git configuration to ~/.gitconfig in 11s.
```
@ -68,7 +68,7 @@ Script Content
.SYNOPSIS
Configures Git
.DESCRIPTION
This PowerShell script configures the Git user settings.
This PowerShell script configures your Git user settings.
.PARAMETER fullName
Specifies the user's full name
.PARAMETER emailAddress
@ -77,12 +77,13 @@ Script Content
Specifies the user's favorite text editor
.EXAMPLE
PS> ./configure-git.ps1 "Joe Doe" joe@doe.com vim
⏳ (1/6) Searching for Git executable... git version 2.42.0.windows.1
⏳ (2/6) Query user settings...
⏳ (3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)...
⏳ (4/6) Saving user settings (name,email,editor)...
⏳ (5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)...
⏳ (6/6) Listing your current settings...
⏳ (1/5) Searching for Git executable... git version 2.42.0.windows.1
⏳ (2/5) Asking for user details...
⏳ (3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)...
⏳ (4/5) Saving user settings (name,email,editor)...
⏳ (5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)...
✅ Saved your Git configuration to ~/.gitconfig in 11s.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -92,17 +93,17 @@ Script Content
param([string]$fullName = "", [string]$emailAddress = "", [string]$favoriteEditor = "")
try {
Write-Host "⏳ (1/6) Searching for Git executable... " -noNewline
Write-Host "⏳ (1/5) Searching for Git executable... " -noNewline
& git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
"⏳ (2/6) Query user settings..."
"⏳ (2/5) Asking for user details..."
if ($fullName -eq "") { $fullName = Read-Host "Enter your full name" }
if ($emailAddress -eq "") { $emailAddress = Read-Host "Enter your e-mail address"}
if ($favoriteEditor -eq "") { $favoriteEditor = Read-Host "Enter your favorite text editor (atom,code,emacs,nano,notepad,subl,vi,vim,...)" }
if ($favoriteEditor -eq "") { $favoriteEditor = Read-Host "Enter your favorite text editor, e.g. atom,code,emacs,nano,notepad,subl,vi,vim" }
$stopWatch = [system.diagnostics.stopwatch]::startNew()
"⏳ (3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)..."
"⏳ (3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)..."
& git config --global core.autocrlf false # don't change newlines
& git config --global core.symlinks true # enable support for symbolic link files
& git config --global core.longpaths true # enable support for long file paths
@ -112,13 +113,13 @@ try {
& git config --global fetch.parallel 0 # enable parallel fetching to improve the speed
if ($lastExitCode -ne "0") { throw "'git config' failed with exit code $lastExitCode" }
"⏳ (4/6) Saving user settings (name,email,editor)..."
"⏳ (4/5) Saving user settings (name,email,editor)..."
& git config --global user.name $fullName
& git config --global user.email $emailAddress
& git config --global core.editor $favoriteEditor
if ($lastExitCode -ne "0") { throw "'git config' failed with exit code $lastExitCode" }
"⏳ (5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)..."
"⏳ (5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)..."
& git config --global alias.br "branch"
& git config --global alias.chp "cherry-pick --no-commit"
& git config --global alias.ci "commit"
@ -131,12 +132,8 @@ try {
& git config --global alias.st "status"
if ($lastExitCode -ne "0") { throw "'git config' failed" }
"⏳ (6/6) Listing your current settings..."
& git config --list
if ($lastExitCode -ne "0") { throw "'git config --list' failed with exit code $lastExitCode" }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Saved your Git configuration in $elapsed sec"
" Saved your Git configuration to ~/.gitconfig in $($elapsed)s."
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber)): $($Error[0])"
@ -144,4 +141,4 @@ try {
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 08/15/2024 09:50:47)*
*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 11/08/2024 12:34:48)*