Colored git output piped to sponge

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












git will color it's output. Staged changes are green and deleted files are red for example.
I have a script running several git commands in parallel and I use sponge to get a nicer output.



But using sponge removes the colors, is there a way to change that?










share|improve this question



























    up vote
    0
    down vote

    favorite












    git will color it's output. Staged changes are green and deleted files are red for example.
    I have a script running several git commands in parallel and I use sponge to get a nicer output.



    But using sponge removes the colors, is there a way to change that?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      git will color it's output. Staged changes are green and deleted files are red for example.
      I have a script running several git commands in parallel and I use sponge to get a nicer output.



      But using sponge removes the colors, is there a way to change that?










      share|improve this question















      git will color it's output. Staged changes are green and deleted files are red for example.
      I have a script running several git commands in parallel and I use sponge to get a nicer output.



      But using sponge removes the colors, is there a way to change that?







      pipe colors git






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 3 '17 at 16:22









      Jeff Schaller

      32.3k849109




      32.3k849109










      asked Oct 3 '17 at 11:32









      rinu

      12




      12




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          Yes, you can force git to output colour codes. For many git subcommands, you can add the --color option:



          git log --color | sponge


          For others, you’ll need to configure the colour output using configuration directives; either per command:



          git -c color.status=always status | sponge


          or for good in one of the configuration files:



          git config --global color.status always
          git status | sponge


          (By default, git disables colour output when its output is sent somewhere other than a terminal. If you want to set the color directive for --color compatible subcommands, you need to use the color.ui key: git config --global color.ui always.)






          share|improve this answer






















          • That doesn't work for git status
            – rinu
            Oct 4 '17 at 6:50










          • I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
            – Stephen Kitt
            Oct 4 '17 at 7:03


















          up vote
          -1
          down vote



          accepted










          Now that I knew what to look for, I found the answer on Stack Overflow:



          git -c color.ui=always -c color.status=always status | sponge





          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f395812%2fcolored-git-output-piped-to-sponge%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            Yes, you can force git to output colour codes. For many git subcommands, you can add the --color option:



            git log --color | sponge


            For others, you’ll need to configure the colour output using configuration directives; either per command:



            git -c color.status=always status | sponge


            or for good in one of the configuration files:



            git config --global color.status always
            git status | sponge


            (By default, git disables colour output when its output is sent somewhere other than a terminal. If you want to set the color directive for --color compatible subcommands, you need to use the color.ui key: git config --global color.ui always.)






            share|improve this answer






















            • That doesn't work for git status
              – rinu
              Oct 4 '17 at 6:50










            • I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
              – Stephen Kitt
              Oct 4 '17 at 7:03















            up vote
            3
            down vote













            Yes, you can force git to output colour codes. For many git subcommands, you can add the --color option:



            git log --color | sponge


            For others, you’ll need to configure the colour output using configuration directives; either per command:



            git -c color.status=always status | sponge


            or for good in one of the configuration files:



            git config --global color.status always
            git status | sponge


            (By default, git disables colour output when its output is sent somewhere other than a terminal. If you want to set the color directive for --color compatible subcommands, you need to use the color.ui key: git config --global color.ui always.)






            share|improve this answer






















            • That doesn't work for git status
              – rinu
              Oct 4 '17 at 6:50










            • I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
              – Stephen Kitt
              Oct 4 '17 at 7:03













            up vote
            3
            down vote










            up vote
            3
            down vote









            Yes, you can force git to output colour codes. For many git subcommands, you can add the --color option:



            git log --color | sponge


            For others, you’ll need to configure the colour output using configuration directives; either per command:



            git -c color.status=always status | sponge


            or for good in one of the configuration files:



            git config --global color.status always
            git status | sponge


            (By default, git disables colour output when its output is sent somewhere other than a terminal. If you want to set the color directive for --color compatible subcommands, you need to use the color.ui key: git config --global color.ui always.)






            share|improve this answer














            Yes, you can force git to output colour codes. For many git subcommands, you can add the --color option:



            git log --color | sponge


            For others, you’ll need to configure the colour output using configuration directives; either per command:



            git -c color.status=always status | sponge


            or for good in one of the configuration files:



            git config --global color.status always
            git status | sponge


            (By default, git disables colour output when its output is sent somewhere other than a terminal. If you want to set the color directive for --color compatible subcommands, you need to use the color.ui key: git config --global color.ui always.)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 4 '17 at 7:03

























            answered Oct 3 '17 at 11:49









            Stephen Kitt

            145k22317382




            145k22317382











            • That doesn't work for git status
              – rinu
              Oct 4 '17 at 6:50










            • I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
              – Stephen Kitt
              Oct 4 '17 at 7:03

















            • That doesn't work for git status
              – rinu
              Oct 4 '17 at 6:50










            • I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
              – Stephen Kitt
              Oct 4 '17 at 7:03
















            That doesn't work for git status
            – rinu
            Oct 4 '17 at 6:50




            That doesn't work for git status
            – rinu
            Oct 4 '17 at 6:50












            I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
            – Stephen Kitt
            Oct 4 '17 at 7:03





            I’ve updated my answer; I didn’t realise you were looking for status (although the green and red references should have given me the hint).
            – Stephen Kitt
            Oct 4 '17 at 7:03













            up vote
            -1
            down vote



            accepted










            Now that I knew what to look for, I found the answer on Stack Overflow:



            git -c color.ui=always -c color.status=always status | sponge





            share|improve this answer


























              up vote
              -1
              down vote



              accepted










              Now that I knew what to look for, I found the answer on Stack Overflow:



              git -c color.ui=always -c color.status=always status | sponge





              share|improve this answer
























                up vote
                -1
                down vote



                accepted







                up vote
                -1
                down vote



                accepted






                Now that I knew what to look for, I found the answer on Stack Overflow:



                git -c color.ui=always -c color.status=always status | sponge





                share|improve this answer














                Now that I knew what to look for, I found the answer on Stack Overflow:



                git -c color.ui=always -c color.status=always status | sponge






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Oct 4 '17 at 9:47

























                answered Oct 4 '17 at 6:59









                rinu

                12




                12



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395812%2fcolored-git-output-piped-to-sponge%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    PYLC R52pa,AiiwMNE,k6r1A1XsYto6B
                    9BXm V7O,F2JCUa pXnqoK1nip E3R9Q,FQFWkWSCyn83vshy bnoa,f

                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    How many registers does an x86_64 CPU actually have?

                    Displaying single band from multi-band raster using QGIS