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

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

Asked on December 21, 2018 in Git.
Add Comment


  • 3 Answer(s)

    Choice A;

    git clone [email protected]:whatever folder-name
    

    Choice B:

    move the .git folder, too.

    Another approach:

    Somewhere else copy the symbolic links to work.

    Answered on December 21, 2018.
    Add Comment

    In the directory you want the contents of the git repository dumped to, run:

    git clone [email protected]:whatever .
    
    

    End of the specifies the current folder as the checkout folder.

    Answered on December 21, 2018.
    Add Comment

    If the folder is empty, then:

    git clone [email protected]:whatever .
    

    Otherwise

    git init
    git remote add origin PATH/TO/REPO
    git fetch
    git checkout -t origin/master
    
    Answered on December 21, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.