1

When I navigate to the directory of my git repo, my command line shows me a lot of stuff. It looks like the output of git-show-branch. I've tried to edit my git config file to change the default for [show-branch] to no avail. I'm up to about 40 commits being listed in my prompt and it's getting to be a real nuisance. Anybody know how to get my prompt back to the default?

OS is RHEL.

Here's what my prompt looks like (## replacing sensitive info):

on ! [backup-master] This is the fixes I need!
 ! [checkout] Added ## and ##. This commit may be garbage
  * [master] Merge branch 'master' of /home/path/path
   ! [oldRval] Added top level cells ## and ##
----
  -  [master] Merge branch 'master' of /home/path/path
  *  [master^2] Changes to ## and level ##. Modified ## boost architecture
  *  [master^2^] Changes to all ##, some ##, many ##
  *  [master^2~2] many schematic changes. Updated ##. Updated ##
  *  [master~2] placement update done. ## done update and ongoing ## errors.
  *  [master~3] ongoing block
  *  [master~4] Updates to ##. Updated to ## for cleaner layout.
  *  [master~5^2] final fixes on ##. Separated ##.
  *  [master~5^2^] This is the fixes I need
  *  [master~6] Updated ##, ## and some ## with ## versions
+    [backup-master] this is the fixes I need
++*  [checkout] Added XX and ## . This commit may be garbage
++*+ [oldRval] Added top level cells ## and ##
5
  • What's the output of echo $PS1?
    – 8bittree
    Commented Jul 10, 2023 at 15:50
  • PS1: undefined variable Commented Jul 10, 2023 at 19:14
  • What shell are you using?
    – 8bittree
    Commented Jul 10, 2023 at 20:15
  • Gnome 3.28.2 is the shell Commented Jul 11, 2023 at 15:51
  • I mean your terminal/command line shell (Bash, Zsh, Fish, etc). My current guess is that your shell's prompt has some git commands in it. If that's the case, then changing git's config files won't do much - you need to change your shell's config files. But $PS1 being undefined caught me by surprise, for one, it holds the prompt format string for many common shells, so that suggests either something is very broken with your setup or you're using a shell I'm unfamiliar with. Second, $PS1 being explicitly called undefined is odd, most shells just expand undefined variables to an empty string.
    – 8bittree
    Commented Jul 11, 2023 at 16:04

1 Answer 1

0

Honestly not sure why it worked, but when I typed the command "bash" the prompt returned to normal. I must have been in some kind of git prompt.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .