Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Created July 16, 2020 20:05
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 sayedihashimi/59ea977a012d5f36d40fa2f08a255e56 to your computer and use it in GitHub Desktop.
Save sayedihashimi/59ea977a012d5f36d40fa2f08a255e56 to your computer and use it in GitHub Desktop.
Get-CurrentBranch powershell function
function Get-CurrentBranch{
[cmdletbinding()]
param()
process{
[string]$result = &git branch --show-current
if(-not $result){
$result = $result.trim();
}
$result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment