Skip to content

Instantly share code, notes, and snippets.

@chrisriesgo
Created November 28, 2018 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisriesgo/334f05c5894e90c80a28f2c77c0ddbc6 to your computer and use it in GitHub Desktop.
Save chrisriesgo/334f05c5894e90c80a28f2c77c0ddbc6 to your computer and use it in GitHub Desktop.
Custom git aliases for Powershell
#####################################
# 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
@chrisriesgo
Copy link
Author

Append this segment to your Powershell profile script (.ps1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment