Created
November 5, 2012 09:45
-
-
Save lucasdinonolte/4016361 to your computer and use it in GitHub Desktop.
Copy current git branch to clipboard
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
git branch | grep "*" | awk '{ print $2 }' | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for those who end up here after today, there is a command built into git to show the current branch
Add these get aliases to your
.gitconfig
and you have the same functionalitygit scb
- shows (prints) current branchgit ccb
- copies the current branch to clipboard