How to git clone with specifying the destination directory without its project name?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I uses macOS and Ubuntu. I want to git clone a certain project https://github.com/Project/project.git to a specific directory $HOME/git. I saw this page: How do you clone a Git repository into a specific folder?, but it requires to explicitly specify its project name like: git clone https://github.com/Project/project.git $HOME/git/project. How can I git clone them without specifying its project name?



[Add1] If I git clone like: git clone https://github.com/Project/project.git $HOME/git
then I encountered fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

[Add2] I want to clone git-managed projects under $HOME/git directory. I want to set the state ls $HOME/git shows like project1/ project2/ project3/.










share|improve this question




















  • 1





    Possible duplicate of How do you clone a Git repository into a specific folder?

    – jonrsharpe
    Nov 16 '18 at 15:21


















1















I uses macOS and Ubuntu. I want to git clone a certain project https://github.com/Project/project.git to a specific directory $HOME/git. I saw this page: How do you clone a Git repository into a specific folder?, but it requires to explicitly specify its project name like: git clone https://github.com/Project/project.git $HOME/git/project. How can I git clone them without specifying its project name?



[Add1] If I git clone like: git clone https://github.com/Project/project.git $HOME/git
then I encountered fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

[Add2] I want to clone git-managed projects under $HOME/git directory. I want to set the state ls $HOME/git shows like project1/ project2/ project3/.










share|improve this question




















  • 1





    Possible duplicate of How do you clone a Git repository into a specific folder?

    – jonrsharpe
    Nov 16 '18 at 15:21














1












1








1








I uses macOS and Ubuntu. I want to git clone a certain project https://github.com/Project/project.git to a specific directory $HOME/git. I saw this page: How do you clone a Git repository into a specific folder?, but it requires to explicitly specify its project name like: git clone https://github.com/Project/project.git $HOME/git/project. How can I git clone them without specifying its project name?



[Add1] If I git clone like: git clone https://github.com/Project/project.git $HOME/git
then I encountered fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

[Add2] I want to clone git-managed projects under $HOME/git directory. I want to set the state ls $HOME/git shows like project1/ project2/ project3/.










share|improve this question
















I uses macOS and Ubuntu. I want to git clone a certain project https://github.com/Project/project.git to a specific directory $HOME/git. I saw this page: How do you clone a Git repository into a specific folder?, but it requires to explicitly specify its project name like: git clone https://github.com/Project/project.git $HOME/git/project. How can I git clone them without specifying its project name?



[Add1] If I git clone like: git clone https://github.com/Project/project.git $HOME/git
then I encountered fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

[Add2] I want to clone git-managed projects under $HOME/git directory. I want to set the state ls $HOME/git shows like project1/ project2/ project3/.







git






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 15:54







Paalon

















asked Nov 16 '18 at 15:17









PaalonPaalon

184




184








  • 1





    Possible duplicate of How do you clone a Git repository into a specific folder?

    – jonrsharpe
    Nov 16 '18 at 15:21














  • 1





    Possible duplicate of How do you clone a Git repository into a specific folder?

    – jonrsharpe
    Nov 16 '18 at 15:21








1




1





Possible duplicate of How do you clone a Git repository into a specific folder?

– jonrsharpe
Nov 16 '18 at 15:21





Possible duplicate of How do you clone a Git repository into a specific folder?

– jonrsharpe
Nov 16 '18 at 15:21












3 Answers
3






active

oldest

votes


















2














Split into 2 commands:



cd $HOME/git
git clone https://github.com/Project/project.git


That way you name the project only once.






share|improve this answer































    1















    How do you clone a Git repository into a specific folder?




    The git clone command can be used in the following way:



     git clone <url> <destination>





    fatal: destination path /home/paalon/git already exists and is not an empty directory.




    This is due to the face that you already have folder with the given name /home/paalon/git.

    Delete the "old folder" and clone again, this time add the desired path to your clone command






    share|improve this answer
























    • Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

      – Paalon
      Nov 16 '18 at 15:49













    • git clone <url> $HOME/git/project1 where project1 is your desired name

      – CodeWizard
      Nov 16 '18 at 15:51











    • Yes. I know it but I want to do it without specifying the project name.

      – Paalon
      Nov 16 '18 at 16:00











    • if you dont specify the name it will get the default name under the current directory where you run git clone

      – CodeWizard
      Nov 16 '18 at 16:10













    • Yes, but I want to specify it from not the current directory.

      – Paalon
      Nov 16 '18 at 17:11



















    0














    I don't think that's actually correct. You can clone providing any directory as your target. It doesn't have to match the project name:



    $ git clone https://github.com/eantoranz/bwv blahblah
    Cloning into 'blahblah'...
    remote: Enumerating objects: 221, done.
    remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
    Receiving objects: 100% (221/221), 62.45 KiB | 480.00 KiB/s, done.
    Resolving deltas: 100% (150/150), done.`1





    share|improve this answer


























    • I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

      – Paalon
      Nov 16 '18 at 15:24













    • Add the error to the question.

      – eftshift0
      Nov 16 '18 at 15:25












    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    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: 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%2fstackoverflow.com%2fquestions%2f53340622%2fhow-to-git-clone-with-specifying-the-destination-directory-without-its-project-n%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Split into 2 commands:



    cd $HOME/git
    git clone https://github.com/Project/project.git


    That way you name the project only once.






    share|improve this answer




























      2














      Split into 2 commands:



      cd $HOME/git
      git clone https://github.com/Project/project.git


      That way you name the project only once.






      share|improve this answer


























        2












        2








        2







        Split into 2 commands:



        cd $HOME/git
        git clone https://github.com/Project/project.git


        That way you name the project only once.






        share|improve this answer













        Split into 2 commands:



        cd $HOME/git
        git clone https://github.com/Project/project.git


        That way you name the project only once.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 19:58









        phdphd

        24.4k52647




        24.4k52647

























            1















            How do you clone a Git repository into a specific folder?




            The git clone command can be used in the following way:



             git clone <url> <destination>





            fatal: destination path /home/paalon/git already exists and is not an empty directory.




            This is due to the face that you already have folder with the given name /home/paalon/git.

            Delete the "old folder" and clone again, this time add the desired path to your clone command






            share|improve this answer
























            • Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

              – Paalon
              Nov 16 '18 at 15:49













            • git clone <url> $HOME/git/project1 where project1 is your desired name

              – CodeWizard
              Nov 16 '18 at 15:51











            • Yes. I know it but I want to do it without specifying the project name.

              – Paalon
              Nov 16 '18 at 16:00











            • if you dont specify the name it will get the default name under the current directory where you run git clone

              – CodeWizard
              Nov 16 '18 at 16:10













            • Yes, but I want to specify it from not the current directory.

              – Paalon
              Nov 16 '18 at 17:11
















            1















            How do you clone a Git repository into a specific folder?




            The git clone command can be used in the following way:



             git clone <url> <destination>





            fatal: destination path /home/paalon/git already exists and is not an empty directory.




            This is due to the face that you already have folder with the given name /home/paalon/git.

            Delete the "old folder" and clone again, this time add the desired path to your clone command






            share|improve this answer
























            • Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

              – Paalon
              Nov 16 '18 at 15:49













            • git clone <url> $HOME/git/project1 where project1 is your desired name

              – CodeWizard
              Nov 16 '18 at 15:51











            • Yes. I know it but I want to do it without specifying the project name.

              – Paalon
              Nov 16 '18 at 16:00











            • if you dont specify the name it will get the default name under the current directory where you run git clone

              – CodeWizard
              Nov 16 '18 at 16:10













            • Yes, but I want to specify it from not the current directory.

              – Paalon
              Nov 16 '18 at 17:11














            1












            1








            1








            How do you clone a Git repository into a specific folder?




            The git clone command can be used in the following way:



             git clone <url> <destination>





            fatal: destination path /home/paalon/git already exists and is not an empty directory.




            This is due to the face that you already have folder with the given name /home/paalon/git.

            Delete the "old folder" and clone again, this time add the desired path to your clone command






            share|improve this answer














            How do you clone a Git repository into a specific folder?




            The git clone command can be used in the following way:



             git clone <url> <destination>





            fatal: destination path /home/paalon/git already exists and is not an empty directory.




            This is due to the face that you already have folder with the given name /home/paalon/git.

            Delete the "old folder" and clone again, this time add the desired path to your clone command







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 16 '18 at 15:38









            CodeWizardCodeWizard

            55.7k1270100




            55.7k1270100













            • Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

              – Paalon
              Nov 16 '18 at 15:49













            • git clone <url> $HOME/git/project1 where project1 is your desired name

              – CodeWizard
              Nov 16 '18 at 15:51











            • Yes. I know it but I want to do it without specifying the project name.

              – Paalon
              Nov 16 '18 at 16:00











            • if you dont specify the name it will get the default name under the current directory where you run git clone

              – CodeWizard
              Nov 16 '18 at 16:10













            • Yes, but I want to specify it from not the current directory.

              – Paalon
              Nov 16 '18 at 17:11



















            • Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

              – Paalon
              Nov 16 '18 at 15:49













            • git clone <url> $HOME/git/project1 where project1 is your desired name

              – CodeWizard
              Nov 16 '18 at 15:51











            • Yes. I know it but I want to do it without specifying the project name.

              – Paalon
              Nov 16 '18 at 16:00











            • if you dont specify the name it will get the default name under the current directory where you run git clone

              – CodeWizard
              Nov 16 '18 at 16:10













            • Yes, but I want to specify it from not the current directory.

              – Paalon
              Nov 16 '18 at 17:11

















            Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

            – Paalon
            Nov 16 '18 at 15:49







            Sorry for my question is ambiguous. I want to clone git things under the $HOME/git directory. So I want to set like ls $HOME/git shows project1/ project2/ project3/ .

            – Paalon
            Nov 16 '18 at 15:49















            git clone <url> $HOME/git/project1 where project1 is your desired name

            – CodeWizard
            Nov 16 '18 at 15:51





            git clone <url> $HOME/git/project1 where project1 is your desired name

            – CodeWizard
            Nov 16 '18 at 15:51













            Yes. I know it but I want to do it without specifying the project name.

            – Paalon
            Nov 16 '18 at 16:00





            Yes. I know it but I want to do it without specifying the project name.

            – Paalon
            Nov 16 '18 at 16:00













            if you dont specify the name it will get the default name under the current directory where you run git clone

            – CodeWizard
            Nov 16 '18 at 16:10







            if you dont specify the name it will get the default name under the current directory where you run git clone

            – CodeWizard
            Nov 16 '18 at 16:10















            Yes, but I want to specify it from not the current directory.

            – Paalon
            Nov 16 '18 at 17:11





            Yes, but I want to specify it from not the current directory.

            – Paalon
            Nov 16 '18 at 17:11











            0














            I don't think that's actually correct. You can clone providing any directory as your target. It doesn't have to match the project name:



            $ git clone https://github.com/eantoranz/bwv blahblah
            Cloning into 'blahblah'...
            remote: Enumerating objects: 221, done.
            remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
            Receiving objects: 100% (221/221), 62.45 KiB | 480.00 KiB/s, done.
            Resolving deltas: 100% (150/150), done.`1





            share|improve this answer


























            • I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

              – Paalon
              Nov 16 '18 at 15:24













            • Add the error to the question.

              – eftshift0
              Nov 16 '18 at 15:25
















            0














            I don't think that's actually correct. You can clone providing any directory as your target. It doesn't have to match the project name:



            $ git clone https://github.com/eantoranz/bwv blahblah
            Cloning into 'blahblah'...
            remote: Enumerating objects: 221, done.
            remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
            Receiving objects: 100% (221/221), 62.45 KiB | 480.00 KiB/s, done.
            Resolving deltas: 100% (150/150), done.`1





            share|improve this answer


























            • I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

              – Paalon
              Nov 16 '18 at 15:24













            • Add the error to the question.

              – eftshift0
              Nov 16 '18 at 15:25














            0












            0








            0







            I don't think that's actually correct. You can clone providing any directory as your target. It doesn't have to match the project name:



            $ git clone https://github.com/eantoranz/bwv blahblah
            Cloning into 'blahblah'...
            remote: Enumerating objects: 221, done.
            remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
            Receiving objects: 100% (221/221), 62.45 KiB | 480.00 KiB/s, done.
            Resolving deltas: 100% (150/150), done.`1





            share|improve this answer















            I don't think that's actually correct. You can clone providing any directory as your target. It doesn't have to match the project name:



            $ git clone https://github.com/eantoranz/bwv blahblah
            Cloning into 'blahblah'...
            remote: Enumerating objects: 221, done.
            remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
            Receiving objects: 100% (221/221), 62.45 KiB | 480.00 KiB/s, done.
            Resolving deltas: 100% (150/150), done.`1






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 16 '18 at 15:52









            CodeWizard

            55.7k1270100




            55.7k1270100










            answered Nov 16 '18 at 15:21









            eftshift0eftshift0

            5,9021022




            5,9021022













            • I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

              – Paalon
              Nov 16 '18 at 15:24













            • Add the error to the question.

              – eftshift0
              Nov 16 '18 at 15:25



















            • I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

              – Paalon
              Nov 16 '18 at 15:24













            • Add the error to the question.

              – eftshift0
              Nov 16 '18 at 15:25

















            I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

            – Paalon
            Nov 16 '18 at 15:24







            I get the following error: $ git clone https://github.com/BoostIO/Boostnote.git $HOME/git fatal: destination path '/home/paalon/git' already exists and is not an empty directory.

            – Paalon
            Nov 16 '18 at 15:24















            Add the error to the question.

            – eftshift0
            Nov 16 '18 at 15:25





            Add the error to the question.

            – eftshift0
            Nov 16 '18 at 15:25


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • 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%2fstackoverflow.com%2fquestions%2f53340622%2fhow-to-git-clone-with-specifying-the-destination-directory-without-its-project-n%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

            Florida Star v. B. J. F.

            Danny Elfman

            Lugert, Oklahoma