Skip to content

Instantly share code, notes, and snippets.

@ThatRubenAguilar
Last active April 28, 2024 16:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThatRubenAguilar/85670a6948c6bec777ddaa2b1e8f5cca to your computer and use it in GitHub Desktop.
Save ThatRubenAguilar/85670a6948c6bec777ddaa2b1e8f5cca to your computer and use it in GitHub Desktop.
Powershell Git Aliases (Windows)

Place in Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

function Get-GitStatus { & git status -sb $args } 
New-Alias -Name gs -Value Get-GitStatus -Force -Option AllScope 
function Get-GitCherryPick { & git cherry-pick $args } 
New-Alias -Name gcp -Value Get-GitCherryPick -Force -Option AllScope
function Get-GitCommitEdit { & git commit -ev $args } 
New-Alias -Name gce -Value Get-GitCommitEdit -Force -Option AllScope 
function Get-GitCommit { & git commit -m $args } 
New-Alias -Name gco -Value Get-GitCommit -Force -Option AllScope 
function Get-GitCommitAmend { & git commit --amend $args } 
New-Alias -Name gca -Value Get-GitCommitAmend -Force -Option AllScope 
function Get-GitAddAll { & git add --all $args } 
New-Alias -Name gaa -Value Get-GitAddAll -Force -Option AllScope 
function Get-GitAdd { & git add -- $args } 
New-Alias -Name ga -Value Get-GitAdd -Force -Option AllScope 
function Get-GitTree { & git log --graph --oneline --decorate $args } 
New-Alias -Name gt -Value Get-GitTree -Force -Option AllScope 
function Get-GitPush { & git push --follow-tags $args } 
New-Alias -Name gps -Value Get-GitPush -Force -Option AllScope 
function Get-GitPullRebase { & git pull --rebase $args } 
New-Alias -Name gpr -Value Get-GitPullRebase -Force -Option AllScope 
function Get-GitFetch { & git fetch $args } 
New-Alias -Name gf -Value Get-GitFetch -Force -Option AllScope 
function Get-GitCheckout { & git checkout $args } 
New-Alias -Name gch -Value Get-GitCheckout -Force -Option AllScope 
function Get-GitCheckoutBranch { & git checkout -b $args } 
New-Alias -Name gchb -Value Get-GitCheckoutBranch -Force -Option AllScope 
function Get-GitBranch { & git branch $args } 
New-Alias -Name gb -Value Get-GitBranch -Force -Option AllScope 
function Get-GitRemoteView { & git remote -v $args } 
New-Alias -Name grv -Value Get-GitRemoteView -Force -Option AllScope
function Get-GitRemoteAdd { & git remote add $args } 
New-Alias -Name gra -Value Get-GitRemoteAdd -Force -Option AllScope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment