Skip to content

Instantly share code, notes, and snippets.

@kventil
Created June 12, 2018 13:04
Show Gist options
  • Save kventil/f4d4b5b55829e8a01f51190bc61e1b4d to your computer and use it in GitHub Desktop.
Save kventil/f4d4b5b55829e8a01f51190bc61e1b4d to your computer and use it in GitHub Desktop.
My Powershellprofile
#Everything GIT
#nothing beats the good old golf
function gti() { echo "Vrooom!"; iex "git $args" }
function ga() { git add -A }
function gs() { git status }
function gas() { git add -A; git status }
function gresetunstaged() { git stash -k -u; git stash drop }
function gcp($msg) { git commit -m "$msg"; git push }
function get() { git pull --ff-only }
#Pretty print graph
function glog() { clear; git --no-pager log --oneline --graph -n 20 --all --format=format:"%<(60,trunc)%s %Cgreen%<(40,ltrunc)%d%Creset" --date-order; echo "`n" }
# fetch, prune pretty print
function gf() { git fetch --all --prune; glog }
#throw away node trash
function clean_node() { git clean -xdf -e "node_modules" -e "bower_components" }
function gco($branch) { git checkout "$branch"}
function rev($branch) {
$currentBranch = git rev-parse --abbrev-ref HEAD
if (-not ($currentBranch -eq "master")) { echo "Not on master"; return }
git merge --no-ff --no-commit "origin/$branch"
}
# okay. i give up.
function nevermind() {
git reset --hard HEAD; git clean -d -f
}
#Enable-GitColors
$Host.UI.RawUI.ForegroundColor = "white"; $Host.UI.RawUI.BackgroundColor = "black";
# reload Path (usefull after installing something)
function reload() {
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
}
# open files or directories osx-like
set-alias -Name open -Value explorer
# sticky fingers
set-alias -Name dc -Value cd
# max history
$MaximumHistoryCount = 10000
#posh specific:
Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-4184928\src\posh-git.psd1'
Import-Module oh-my-posh
Set-Theme paradox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment