Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

can we store the name of the current branch in a variable in bash

branch_name=$(git branch | sed -n -e 's/^* (.*)/1/p')
 
PREVIOUS NEXT
Tagged: #store #current #branch #variable #bash
ADD COMMENT
Topic
Name
1+7 =