1

I am following the Udacity course where in Lesson 1 video 29. they talk about customizing the git bash and setting up workspace.

I did dig into how the .bash_profile should be edited and it almost works as I want it. Except I can't figure out how to add a new line in front of the command prompt $ sign.

TITLESTRING="Bash Prompt (Git for Windows) =>"
TITLE="\[\033]0;$TITLESTRING${PWD//[^[:ascii:]]/?}\007\]"
export PS1="$TITLE\n$GREEN\u@\h$MAGENTA\$(__git_ps1) $LIGHT_YELLOW\w $RESET\n$ "

When I put the \n before the last $ sign in order to make it appear in the next line, then I get this error message on starting git bash:

bash: command substitution: line 1: syntax error near unexpected token `)'
bash: command substitution: line 1: `__git_ps1)'

Mik@BIG_PC~
$

When I don't have that \n in front of the last $ sign then all is good.

Please help me whit this.

Bar6
  • 31
  • 5

1 Answers1

0

It seems to be working if you are using $(__git_ps1), not \$(__git_ps1).

I get:

vonc@bvonc (master) ~/data/git/git
$ git version
git version 2.12.1.windows.1

You can see many other examples of $(__git_ps1) usage in "PS1 line with git current branch and colors", and I never see \$(...).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250