Skip to content

Instantly share code, notes, and snippets.

View ThatRubenAguilar's full-sized avatar

Ruben Aguilar ThatRubenAguilar

  • RelayHealth
  • Berkeley, CA
View GitHub Profile
@ThatRubenAguilar
ThatRubenAguilar / PS_Profile_With_Posh_Git.md
Created April 5, 2017 07:35
Load posh git into every powershell window

Place in Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 after installing posh-git

# Load posh-git example profile
. 'Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
@ThatRubenAguilar
ThatRubenAguilar / prepare-commit-msg
Last active March 13, 2017 20:03
How to automatically prepend git commit with a branch name except for major branches
#!/bin/sh
#
# Prepend the branch name to the commit message
# Based on https://gist.github.com/bartoszmajsak/1396344
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg
#
# A couple notes:
# 1. The file must be executable (chmod +x prepare-commit-msg)
# 2. This works on a per-repo basis (unless you follow this guide https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)
@ThatRubenAguilar
ThatRubenAguilar / powershell_gitaliases_windows.md
Last active April 28, 2024 16:18
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 
@ThatRubenAguilar
ThatRubenAguilar / gitaliases_windows.md
Last active March 12, 2017 22:44
Git Aliases (Windows)

Explanation of commands here

cmd:

git config --global alias.aa "add --all" 
git config --global alias.bv "branch -vv" 
git config --global alias.ba "branch -ra" 
git config --global alias.bd "branch -d" 
git config --global alias.cp "cherry-pick" 
git config --global alias.ca "commit --amend"