Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
powershell_git [2021/12/19 03:16] – created mgupton | powershell_git [2022/01/01 18:48] (current) – mgupton | ||
---|---|---|---|
Line 2: | Line 2: | ||
=== git-init.ps1 === | === git-init.ps1 === | ||
+ | PS script to initialize a new Git repo. | ||
<code powershell> | <code powershell> | ||
if (-not(Test-Path -Path " | if (-not(Test-Path -Path " | ||
Line 8: | Line 8: | ||
git config --global core.excludesFile ~/ | git config --global core.excludesFile ~/ | ||
- | git config user.name "John Doe" | + | git config |
- | git config user.email jd@infostar.me | + | git config |
git commit --allow-empty -m "Empty commit for initializing the repo" | git commit --allow-empty -m "Empty commit for initializing the repo" | ||
git checkout -b working | git checkout -b working | ||
} | } | ||
</ | </ | ||
+ | |||
+ | === Command Aliases === | ||
+ | <code powershell> | ||
+ | |||
+ | function git-init { | ||
+ | if (-not(Test-Path -Path " | ||
+ | git init | ||
+ | | ||
+ | git config --global core.excludesFile ~/ | ||
+ | git config --global user.name "John Doe" | ||
+ | git config --global user.email jd@infostar.me | ||
+ | git commit --allow-empty -m "Empty commit for initializing the repo" | ||
+ | git checkout -b working | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function git-save { | ||
+ | git add .; git commit | ||
+ | } | ||
+ | |||
+ | function git-save-push () { | ||
+ | git-save | ||
+ | git push -u origin head | ||
+ | } | ||
+ | |||
+ | function mgl { | ||
+ | git log | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # List files that were part of the specified commit. | ||
+ | # | ||
+ | function git-ls($commit) { | ||
+ | git ls-tree --name-only -r $commit | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # Show the details, including changes made, for the specified commit. | ||
+ | # | ||
+ | function git-show($commit) { | ||
+ | git show --name-only $commit | ||
+ | } | ||
+ | </ | ||
+ | |||