Skip to content

Instantly share code, notes, and snippets.

@RenovZ
Forked from dunckr/$profile.ps1
Created December 31, 2024 08:15
Show Gist options
  • Select an option

  • Save RenovZ/43db76d3f6028e47d19d8f0fce1c6733 to your computer and use it in GitHub Desktop.

Select an option

Save RenovZ/43db76d3f6028e47d19d8f0fce1c6733 to your computer and use it in GitHub Desktop.
Powershell Aliases for Git
# Remove Defaults
rename-item alias:\gc gk -force
rename-item alias:\gcm gkm -force
rename-item alias:\gl gll -force
rename-item alias:\gsn gsnn -force
rename-item alias:\gm gmm -force
# Git
function git-status { git status }
Set-Alias -Name gst -Value git-status
function git-addall { git add -A }
Set-Alias -Name gaa -Value git-addall
function git-branch { git branch $args }
Set-Alias -Name gb -Value git-branch
function git-diff { git diff $args }
Set-Alias -Name gd -Value git-diff
function git-diff-cached { git diff --cached }
Set-Alias -Name gdc -Value git-diff-cached
function git-diff-master { git diff master }
Set-Alias -Name gdm -Value git-diff-master
function git-diff-dev { git diff dev }
Set-Alias -Name gdd -Value git-diff-dev
function git-commit-all { git commit -a }
Set-Alias -Name gca -Value git-commit-all
function git-commit-m { git commit -m $args }
Set-Alias -Name gcm -Value git-commit-m
function git-checkout { git checkout $args }
Set-Alias -Name gco -Value git-checkout
function git-log { git log }
Set-Alias -Name gl -Value git-log
function git-fetch { git fetch }
Set-Alias -Name gf -Value git-fetch
function git-rebase-continue { git rebase --continue }
Set-Alias -Name grc -Value git-rebase-continue
# Misc
function back-dir { cd .. }
Set-Alias -Name .. -Value back-dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment