git clone from another directory

前端 未结 8 2009
一生所求
一生所求 2020-12-04 07:38

I am trying to clone repo from another directory.

Lets say I have one repo in C:/folder1 and C:/folder2

I want to clone the work in

8条回答
  •  孤城傲影
    2020-12-04 08:15

    It's as easy as it looks.

    14:27:05 ~$ mkdir gittests
    14:27:11 ~$ cd gittests/
    14:27:13 ~/gittests$ mkdir localrepo
    14:27:20 ~/gittests$ cd localrepo/
    14:27:21 ~/gittests/localrepo$ git init
    Initialized empty Git repository in /home/andwed/gittests/localrepo/.git/
    14:27:22 ~/gittests/localrepo (master #)$ cd ..
    14:27:35 ~/gittests$ git clone localrepo copyoflocalrepo
    Cloning into 'copyoflocalrepo'...
    warning: You appear to have cloned an empty repository.
    done.
    14:27:42 ~/gittests$ cd copyoflocalrepo/
    14:27:46 ~/gittests/copyoflocalrepo (master #)$ git status
    On branch master
    
    Initial commit
    
    nothing to commit (create/copy files and use "git add" to track)
    14:27:46 ~/gittests/copyoflocalrepo (master #)$ 
    

提交回复
热议问题