source: http://stackoverflow.com/questions/2411031/how-do-i-clone-into-a-non-empty-directory
reference: http://stackoverflow.com/questions/9864728/how-to-get-git-to-clone-into-current-directory
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/master' which can not be resolved as commit?
그 외의 경우엔, 아래와 같은 시나리오로 잘 공존하게 된다.
reference: http://stackoverflow.com/questions/9864728/how-to-get-git-to-clone-into-current-directory
git init
git remote add origin PATH/TO/REPO
git fetch
git checkout -t origin/master
Note: 만약 origin/master에 있는 폴더나 파일 이름이 같은 것이 존재한다면 아래와 같은 에러를 뿜는다.fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/master' which can not be resolved as commit?
그 외의 경우엔, 아래와 같은 시나리오로 잘 공존하게 된다.
user-id@localhost:/tmp$ touch FILE1
user-id@localhost:/tmp$ ls -al
합계 8
drwxrwxr-x 2 user-id user-id 4096 Mar 5 11:38 .
drwxrwxrwt 21 root root 4096 Mar 5 11:38 ..
-rw-rw-r-- 1 user-id user-id 0 Mar 5 11:38 FILE1
user-id@localhost:/tmp$ git init
Initialized empty Git repository in /tmp/.git/
user-id@localhost:/tmp$ git remote add origin http://git-id@git-server-ip/repository.git
user-id@localhost:/tmp$ git fetch
Password for 'http://git-id@git-server-ip':
From http://git-server-ip/repository
* [new branch] master -> origin/master
user-id@localhost:/tmp$ git checkout -t origin/master
Branch master set up to track remote branch master from origin.
Already on 'master'
user-id@localhost:/tmp$ ls -al
합계 32
drwxrwxr-x 5 user-id user-id 4096 2014-03-05 11:39 ./
drwxrwxrwt 21 root root 4096 2014-03-05 11:38 ../
drwxrwxr-x 8 user-id user-id 4096 2014-03-05 11:39 .git/
-rw-rw-r-- 1 user-id user-id 37 2014-03-05 11:39 .gitignore
-rw-rw-r-- 1 user-id user-id 0 2014-03-05 11:38 FILE1
drwxrwxr-x 3 user-id user-id 4096 2014-03-05 11:39 test1/
drwxrwxr-x 2 user-id user-id 4096 2014-03-05 11:39 test2/
user-id@localhost:/tmp$
댓글
댓글 쓰기