How to get Git to clone into current directory

How to get Git to clone into current directory

Asked on January 7, 2019 in Git.
Add Comment


  • 4 Answer(s)

    Here the following below code:

    git clone [email protected]:user/my-project.git .
    
    

    Git help clone:

    Cloning into an existing directory is only enable if the directory is empty.

    The directory is empty check with ls -a.

    Answered on January 7, 2019.
    Add Comment

    Here the alternative below code:

    git init .
    git remote add -t \* -f origin <repository-url>
    git checkout master
    

    This produces a .git/config file

    Answered on January 7, 2019.
    Add Comment

    Try this below code:

    git init .
    git remote add origin <repository-url>
    git pull origin master
    
    Answered on January 7, 2019.
    Add Comment

    simply put a dot next to it

    git clone [email protected]:user/my-project.git .
    

    From git help clone:

    Cloning into an existing directory is only allowed if the directory is empty.

    So make sure the directory is empty (check with ls -a), otherwise the command will fail.

    Answered on March 5, 2019.
    Add Comment


  • Your Answer

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