Skip to content

Commit

Permalink
Copy branch name to clipboard with gcb
Browse files Browse the repository at this point in the history
  • Loading branch information
holman committed Feb 4, 2014
1 parent 3e3d9bb commit 10b2626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/git-copy-branch-name
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
#
# Copy the current branch name to the clipboard.

branch=$(git rev-parse --abbrev-ref HEAD)
echo $branch
echo $branch | tr -d '\n' | tr -d ' ' | pbcopy
1 change: 1 addition & 0 deletions git/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ alias gd='git diff'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gcb='git copy-branch-name'
alias gb='git branch'
alias gs='git status -sb' # upgrade your git if -sb breaks for you. it's fun.
alias grm="git status | grep deleted | awk '{\$1=\$2=\"\"; print \$0}' | \
Expand Down

0 comments on commit 10b2626

Please sign in to comment.