How can I get the Linux terminal to look like Windows Git Bash?












1














Before anyone says it, yes, I know this is a duplicate, except when I copy/paste that code into tilde slash period bash(no period)rc, the terminal hasn't changed at all.



I'm running Debian on Virtual Box (Windows 10). I'm guessing I'm using the Mate desktop because I'm using Mate terminal.



When I go into a directory with git, I need to type in git status or git branch to see what branch I'm on, it doesn't display it like it's supposed to with the code.



EDIT: The code I pasted



force_color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


EDIT 2:So it turns out my .bashrc file had



 if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


printed somewhere else in it. I commented that out and now I get branch (whatever) when I'm in a git directory without needing to type git branch or git status. The problem I have now is the colors won't show up. This isn't a major issue, though it would be nice to have.










share|improve this question
























  • Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
    – AmeyaVS
    Dec 20 '18 at 4:35












  • @AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
    – 00Saad
    Dec 20 '18 at 4:37










  • Can you update the question post with the output?
    – AmeyaVS
    Dec 20 '18 at 4:40
















1














Before anyone says it, yes, I know this is a duplicate, except when I copy/paste that code into tilde slash period bash(no period)rc, the terminal hasn't changed at all.



I'm running Debian on Virtual Box (Windows 10). I'm guessing I'm using the Mate desktop because I'm using Mate terminal.



When I go into a directory with git, I need to type in git status or git branch to see what branch I'm on, it doesn't display it like it's supposed to with the code.



EDIT: The code I pasted



force_color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


EDIT 2:So it turns out my .bashrc file had



 if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


printed somewhere else in it. I commented that out and now I get branch (whatever) when I'm in a git directory without needing to type git branch or git status. The problem I have now is the colors won't show up. This isn't a major issue, though it would be nice to have.










share|improve this question
























  • Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
    – AmeyaVS
    Dec 20 '18 at 4:35












  • @AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
    – 00Saad
    Dec 20 '18 at 4:37










  • Can you update the question post with the output?
    – AmeyaVS
    Dec 20 '18 at 4:40














1












1








1







Before anyone says it, yes, I know this is a duplicate, except when I copy/paste that code into tilde slash period bash(no period)rc, the terminal hasn't changed at all.



I'm running Debian on Virtual Box (Windows 10). I'm guessing I'm using the Mate desktop because I'm using Mate terminal.



When I go into a directory with git, I need to type in git status or git branch to see what branch I'm on, it doesn't display it like it's supposed to with the code.



EDIT: The code I pasted



force_color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


EDIT 2:So it turns out my .bashrc file had



 if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


printed somewhere else in it. I commented that out and now I get branch (whatever) when I'm in a git directory without needing to type git branch or git status. The problem I have now is the colors won't show up. This isn't a major issue, though it would be nice to have.










share|improve this question















Before anyone says it, yes, I know this is a duplicate, except when I copy/paste that code into tilde slash period bash(no period)rc, the terminal hasn't changed at all.



I'm running Debian on Virtual Box (Windows 10). I'm guessing I'm using the Mate desktop because I'm using Mate terminal.



When I go into a directory with git, I need to type in git status or git branch to see what branch I'm on, it doesn't display it like it's supposed to with the code.



EDIT: The code I pasted



force_color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


EDIT 2:So it turns out my .bashrc file had



 if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt


printed somewhere else in it. I commented that out and now I get branch (whatever) when I'm in a git directory without needing to type git branch or git status. The problem I have now is the colors won't show up. This isn't a major issue, though it would be nice to have.







linux bash git bashrc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 4:42

























asked Dec 20 '18 at 4:18









00Saad

62




62












  • Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
    – AmeyaVS
    Dec 20 '18 at 4:35












  • @AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
    – 00Saad
    Dec 20 '18 at 4:37










  • Can you update the question post with the output?
    – AmeyaVS
    Dec 20 '18 at 4:40


















  • Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
    – AmeyaVS
    Dec 20 '18 at 4:35












  • @AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
    – 00Saad
    Dec 20 '18 at 4:37










  • Can you update the question post with the output?
    – AmeyaVS
    Dec 20 '18 at 4:40
















Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
– AmeyaVS
Dec 20 '18 at 4:35






Did you try and run the command in parse_git_branch function manually in a terminal at a git repository location?
– AmeyaVS
Dec 20 '18 at 4:35














@AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
– 00Saad
Dec 20 '18 at 4:37




@AmeyaVS, when I run git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' in a git directory, I get the branch I'm on in parentheses
– 00Saad
Dec 20 '18 at 4:37












Can you update the question post with the output?
– AmeyaVS
Dec 20 '18 at 4:40




Can you update the question post with the output?
– AmeyaVS
Dec 20 '18 at 4:40










2 Answers
2






active

oldest

votes


















0














You may need to source the file again. Either log out or do this:



source ~/.bashrc





share|improve this answer





























    0














    It is probably you are missing the PS1 prompt configuration for your user id.

    You probably can use this which has those features and more.



    Update

    Here is my PS1 bash shell prompt with added escape sequences for the colors:



    export PS1="[e]0;wa]n[e[32m]u@h [e[33m]w[e[0m][33[1;36m]$(parse_git_branch)[33[00m]n$ "





    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f490065%2fhow-can-i-get-the-linux-terminal-to-look-like-windows-git-bash%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You may need to source the file again. Either log out or do this:



      source ~/.bashrc





      share|improve this answer


























        0














        You may need to source the file again. Either log out or do this:



        source ~/.bashrc





        share|improve this answer
























          0












          0








          0






          You may need to source the file again. Either log out or do this:



          source ~/.bashrc





          share|improve this answer












          You may need to source the file again. Either log out or do this:



          source ~/.bashrc






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 20 '18 at 4:25









          wef

          993




          993

























              0














              It is probably you are missing the PS1 prompt configuration for your user id.

              You probably can use this which has those features and more.



              Update

              Here is my PS1 bash shell prompt with added escape sequences for the colors:



              export PS1="[e]0;wa]n[e[32m]u@h [e[33m]w[e[0m][33[1;36m]$(parse_git_branch)[33[00m]n$ "





              share|improve this answer




























                0














                It is probably you are missing the PS1 prompt configuration for your user id.

                You probably can use this which has those features and more.



                Update

                Here is my PS1 bash shell prompt with added escape sequences for the colors:



                export PS1="[e]0;wa]n[e[32m]u@h [e[33m]w[e[0m][33[1;36m]$(parse_git_branch)[33[00m]n$ "





                share|improve this answer


























                  0












                  0








                  0






                  It is probably you are missing the PS1 prompt configuration for your user id.

                  You probably can use this which has those features and more.



                  Update

                  Here is my PS1 bash shell prompt with added escape sequences for the colors:



                  export PS1="[e]0;wa]n[e[32m]u@h [e[33m]w[e[0m][33[1;36m]$(parse_git_branch)[33[00m]n$ "





                  share|improve this answer














                  It is probably you are missing the PS1 prompt configuration for your user id.

                  You probably can use this which has those features and more.



                  Update

                  Here is my PS1 bash shell prompt with added escape sequences for the colors:



                  export PS1="[e]0;wa]n[e[32m]u@h [e[33m]w[e[0m][33[1;36m]$(parse_git_branch)[33[00m]n$ "






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 20 '18 at 4:49

























                  answered Dec 20 '18 at 4:30









                  AmeyaVS

                  1718




                  1718






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f490065%2fhow-can-i-get-the-linux-terminal-to-look-like-windows-git-bash%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Morgemoulin

                      Scott Moir

                      Souastre