Git - Error invalid path











up vote
8
down vote

favorite












I have been working for so long on a mac and have committed it looks like a file like this:



C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


This file does not exist in the repository. My repository was actually located in /Users/Sethuram/Development/Csmart/workspaces/csmart. It looks like I might have somehow checked in a file with the name C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls into my git repo and pushed it.



Now I am trying to clone this repo on my windows box and I get an error like below:



error: Invalid path 'C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls'


I understand its an invalid path. I am not sure how to correct it. I dont have access to my mac anymore to delete and push from there.



On the windows box this file appears as a change I need to commit:



$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


How do I get rid of this error?










share|improve this question
























  • There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
    – centic
    Sep 12 '14 at 5:43















up vote
8
down vote

favorite












I have been working for so long on a mac and have committed it looks like a file like this:



C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


This file does not exist in the repository. My repository was actually located in /Users/Sethuram/Development/Csmart/workspaces/csmart. It looks like I might have somehow checked in a file with the name C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls into my git repo and pushed it.



Now I am trying to clone this repo on my windows box and I get an error like below:



error: Invalid path 'C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls'


I understand its an invalid path. I am not sure how to correct it. I dont have access to my mac anymore to delete and push from there.



On the windows box this file appears as a change I need to commit:



$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


How do I get rid of this error?










share|improve this question
























  • There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
    – centic
    Sep 12 '14 at 5:43













up vote
8
down vote

favorite









up vote
8
down vote

favorite











I have been working for so long on a mac and have committed it looks like a file like this:



C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


This file does not exist in the repository. My repository was actually located in /Users/Sethuram/Development/Csmart/workspaces/csmart. It looks like I might have somehow checked in a file with the name C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls into my git repo and pushed it.



Now I am trying to clone this repo on my windows box and I get an error like below:



error: Invalid path 'C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls'


I understand its an invalid path. I am not sure how to correct it. I dont have access to my mac anymore to delete and push from there.



On the windows box this file appears as a change I need to commit:



$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


How do I get rid of this error?










share|improve this question















I have been working for so long on a mac and have committed it looks like a file like this:



C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


This file does not exist in the repository. My repository was actually located in /Users/Sethuram/Development/Csmart/workspaces/csmart. It looks like I might have somehow checked in a file with the name C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls into my git repo and pushed it.



Now I am trying to clone this repo on my windows box and I get an error like below:



error: Invalid path 'C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls'


I understand its an invalid path. I am not sure how to correct it. I dont have access to my mac anymore to delete and push from there.



On the windows box this file appears as a change I need to commit:



$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


How do I get rid of this error?







windows mac git






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 7 '13 at 7:05









Kevin Panko

5,799113648




5,799113648










asked Oct 7 '13 at 6:35









sethu

14117




14117












  • There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
    – centic
    Sep 12 '14 at 5:43


















  • There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
    – centic
    Sep 12 '14 at 5:43
















There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
– centic
Sep 12 '14 at 5:43




There is a similar question at stackoverflow.com/questions/25772908/crawling-github-with-jgit
– centic
Sep 12 '14 at 5:43










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You can check out the file to another path, such as to the current directory



git checkout -- <path>/<file>


In your case, it should be



git checkout -- C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


You can also specify a directory to extract your file



git checkout-index --prefix=destination/path/ C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


If that does not help, just export all files into a new directory



$ git checkout-index --prefix=git-export-dir/ -a


For more information , refer to the documentation for git checkout-index






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fsuperuser.com%2fquestions%2f655318%2fgit-error-invalid-path%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You can check out the file to another path, such as to the current directory



    git checkout -- <path>/<file>


    In your case, it should be



    git checkout -- C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


    You can also specify a directory to extract your file



    git checkout-index --prefix=destination/path/ C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


    If that does not help, just export all files into a new directory



    $ git checkout-index --prefix=git-export-dir/ -a


    For more information , refer to the documentation for git checkout-index






    share|improve this answer



























      up vote
      0
      down vote













      You can check out the file to another path, such as to the current directory



      git checkout -- <path>/<file>


      In your case, it should be



      git checkout -- C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


      You can also specify a directory to extract your file



      git checkout-index --prefix=destination/path/ C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


      If that does not help, just export all files into a new directory



      $ git checkout-index --prefix=git-export-dir/ -a


      For more information , refer to the documentation for git checkout-index






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        You can check out the file to another path, such as to the current directory



        git checkout -- <path>/<file>


        In your case, it should be



        git checkout -- C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


        You can also specify a directory to extract your file



        git checkout-index --prefix=destination/path/ C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


        If that does not help, just export all files into a new directory



        $ git checkout-index --prefix=git-export-dir/ -a


        For more information , refer to the documentation for git checkout-index






        share|improve this answer














        You can check out the file to another path, such as to the current directory



        git checkout -- <path>/<file>


        In your case, it should be



        git checkout -- C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


        You can also specify a directory to extract your file



        git checkout-index --prefix=destination/path/ C:/Csmart/files/companies/19/migration/CompanyDataEntry.xls


        If that does not help, just export all files into a new directory



        $ git checkout-index --prefix=git-export-dir/ -a


        For more information , refer to the documentation for git checkout-index







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 8 '17 at 18:15









        JakeGould

        30.8k1093137




        30.8k1093137










        answered Feb 25 '16 at 7:36









        hanxue

        1,70011937




        1,70011937






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f655318%2fgit-error-invalid-path%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

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy