Save GIT branch name in Terminal: You want to see the branch name on the branch which are working on.
I had faced a problem where accidentally, i changed the origin/master codes which caused too many code conflict issues within the team. It was a shame and prickly situations within the team.
Solution :
Solution :
- Go to your
MAC
Terminal. - Type $
vi ~/.bash_profile.
- Enter this code
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
- Now press
"escape button,:(colon),w(save),q(quit),!"
to come out of the editor. - Type
source ~/.bash_profile