반응형
git clone 디렉토리 지정 및 변경 방법
git clone 명령어로 저장소를 복제할 때 복제된 디렉토리 경로를 지정하거나 변경할 수 있습니다.
1. 디렉토리를 미리 생성하고 복제하기
mkdir my_project
cd my_project
git clone <repository_url>
2. 복제 시 바로 디렉토리 이름 지정하기
git clone 명령어에서 목적지 디렉토리 이름을 직접 지정할 수 있습니다.
git clone <repository_url> <destination>
git cloen https://github.com/anti1346/project1.git project
Cloning into 'project'...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 64 (delta 19), reused 38 (delta 9), pack-reused 0
Unpacking objects: 100% (64/64), done.
$ ls -l
합계 0
drwxr-xr-x 3 root root 90 1월 25 14:59 project
3. -o 또는 --origin 옵션 사용하기
-o 또는 --origin 옵션으로 원격 저장소 이름을 변경할 수도 있습니다. 기본값은 origin입니다.
git clone -o new_origin <repository_url> <destination_directory>
git clone -o upstream https://github.com/anti1346/project1.git project
728x90
반응형
'리눅스' 카테고리의 다른 글
CentOS 8 Stream 설치(CentOS 8 스트림 설치) (0) | 2021.01.26 |
---|---|
tput 명령어 (0) | 2021.01.25 |
리눅스에서 패스워드를 한 줄로 변경하는 방법 (0) | 2021.01.25 |
sshpass 명령어 (0) | 2021.01.22 |
CentOS 7에서 lsyncd와 rsync를 사용하여 파일의 실시간 동기화를 설정하는 방법 (0) | 2021.01.22 |