Last active
September 2, 2022 01:25
-
-
Save Bak-Jin-Hyeong/894853010eac6585d4e4be4d4e54c6e7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env pwsh | |
git branch --format "%(if:equals=*)%(HEAD)%(then)%(refname:short)`t%(upstream:short)%(end)" | ` | |
Where-Object { $_.Length -ne 0 } | ` | |
ForEach-Object { $s = $_.Split("`t"); @{'branch'=$s[0]; 'upstream'=$s[1] } } | ` | |
ConvertTo-Json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment