Created
November 28, 2018 17:15
-
-
Save chrisriesgo/334f05c5894e90c80a28f2c77c0ddbc6 to your computer and use it in GitHub Desktop.
Custom git aliases for Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################### | |
# Git Alias Section | |
##################################### | |
function Get-EditGitConfig() { | |
code $HOME/.gitconfig | |
} | |
function Get-GitFetchAll() { | |
git fetch --all | |
} | |
function Get-GitMergeUpstreamDevelopFFOnly() { | |
git merge upstream/develop --ff-only | |
} | |
function Get-GitMergeUpstreamCurrentBranchFFOnly() { | |
$currentbranch = Get-GitBranch | |
git merge upstream/$currentbranch --ff-only | |
} | |
function Get-GitCheckout() { | |
git checkout $args | |
} | |
Set-Alias gitconfig Get-EditGitConfig | |
Set-Alias gfa Get-GitFetchAll | |
Set-Alias gmdff Get-GitMergeUpstreamDevelopFFOnly | |
Set-Alias gmuff Get-GitMergeUpstreamCurrentBranchFFOnly | |
Set-Alias gco Get-GitCheckout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Append this segment to your Powershell profile script (
.ps1
)