Git unstash all files from list

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











up vote
1
down vote

favorite
1












I created a list by using



$ git stash show --name-only | grep -i "Kopie"


Output:



A - Kopie.txt
B - Kopie.txt


How can I unstash all the files from the list?




First Approach:



$ git stash show --name-only | grep -i "Kopie" | xargs git checkout stash@0 --


Result:




error: pathspec 'A' did not match any file(s) known to git.
error: pathspec '-' did not match any file(s) known to git.
error: pathspec 'Kopie.txt' did not match any file(s) known to git.
error: pathspec 'B' did not match any file(s) known to git.
error: pathspec '-' did not match any file(s) known to git.
error: pathspec 'Kopie.txt' did not match any file(s) known to git.







share|improve this question

























    up vote
    1
    down vote

    favorite
    1












    I created a list by using



    $ git stash show --name-only | grep -i "Kopie"


    Output:



    A - Kopie.txt
    B - Kopie.txt


    How can I unstash all the files from the list?




    First Approach:



    $ git stash show --name-only | grep -i "Kopie" | xargs git checkout stash@0 --


    Result:




    error: pathspec 'A' did not match any file(s) known to git.
    error: pathspec '-' did not match any file(s) known to git.
    error: pathspec 'Kopie.txt' did not match any file(s) known to git.
    error: pathspec 'B' did not match any file(s) known to git.
    error: pathspec '-' did not match any file(s) known to git.
    error: pathspec 'Kopie.txt' did not match any file(s) known to git.







    share|improve this question























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I created a list by using



      $ git stash show --name-only | grep -i "Kopie"


      Output:



      A - Kopie.txt
      B - Kopie.txt


      How can I unstash all the files from the list?




      First Approach:



      $ git stash show --name-only | grep -i "Kopie" | xargs git checkout stash@0 --


      Result:




      error: pathspec 'A' did not match any file(s) known to git.
      error: pathspec '-' did not match any file(s) known to git.
      error: pathspec 'Kopie.txt' did not match any file(s) known to git.
      error: pathspec 'B' did not match any file(s) known to git.
      error: pathspec '-' did not match any file(s) known to git.
      error: pathspec 'Kopie.txt' did not match any file(s) known to git.







      share|improve this question













      I created a list by using



      $ git stash show --name-only | grep -i "Kopie"


      Output:



      A - Kopie.txt
      B - Kopie.txt


      How can I unstash all the files from the list?




      First Approach:



      $ git stash show --name-only | grep -i "Kopie" | xargs git checkout stash@0 --


      Result:




      error: pathspec 'A' did not match any file(s) known to git.
      error: pathspec '-' did not match any file(s) known to git.
      error: pathspec 'Kopie.txt' did not match any file(s) known to git.
      error: pathspec 'B' did not match any file(s) known to git.
      error: pathspec '-' did not match any file(s) known to git.
      error: pathspec 'Kopie.txt' did not match any file(s) known to git.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 7 at 16:33
























      asked Jun 7 at 9:19









      Black

      4932728




      4932728




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You are not quoting the filenames when they are passed to git checkout, so A, - & Kopie.txt are being treated as different files.



          Try adding the -I option to xargs, then put quotes around :



          git stash show --name-only | grep -i "Kopie" | xargs -I git checkout stash@0 -- ""





          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%2f448371%2fgit-unstash-all-files-from-list%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            You are not quoting the filenames when they are passed to git checkout, so A, - & Kopie.txt are being treated as different files.



            Try adding the -I option to xargs, then put quotes around :



            git stash show --name-only | grep -i "Kopie" | xargs -I git checkout stash@0 -- ""





            share|improve this answer

























              up vote
              2
              down vote



              accepted










              You are not quoting the filenames when they are passed to git checkout, so A, - & Kopie.txt are being treated as different files.



              Try adding the -I option to xargs, then put quotes around :



              git stash show --name-only | grep -i "Kopie" | xargs -I git checkout stash@0 -- ""





              share|improve this answer























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                You are not quoting the filenames when they are passed to git checkout, so A, - & Kopie.txt are being treated as different files.



                Try adding the -I option to xargs, then put quotes around :



                git stash show --name-only | grep -i "Kopie" | xargs -I git checkout stash@0 -- ""





                share|improve this answer













                You are not quoting the filenames when they are passed to git checkout, so A, - & Kopie.txt are being treated as different files.



                Try adding the -I option to xargs, then put quotes around :



                git stash show --name-only | grep -i "Kopie" | xargs -I git checkout stash@0 -- ""






                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Jun 7 at 9:35









                rusty shackleford

                1,135115




                1,135115






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448371%2fgit-unstash-all-files-from-list%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

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

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?