Git 복제, 디렉토리 충돌을 처리하는 방법은 무엇입니까?

Git 복제, 디렉토리 충돌을 처리하는 방법은 무엇입니까?

Git Clone은 GitHub 저장소의 모든 파일을 GitHub 저장소와 정확히 동일한 디렉터리에 쉽게 다운로드할 수 있다는 것을 알았습니다(아카이브를 처리할 필요가 없음).

저장소와 동일한 디렉터리가 이미 존재하는 경우 Git에서 오류가 발생합니다.

치명적: 대상 경로 'REPOSITORY_NAME'이 이미 존재하며 빈 디렉터리가 아닙니다.

이런 경우에는 어떤 방식으로든 복제를 하되 다른 이름의 디렉터리에 데이터를 저장하는 것이 좋은 대책이 될 수 있습니다.

답변1

git clone또한 명령줄에서 디렉터리 이름을 가져옵니다. 에서 man git-clone:

NAME
       git-clone - Clone a repository into a new directory

SYNOPSIS
       git clone [--template=<template_directory>]
                 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
                 [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
                 [--dissociate] [--separate-git-dir <git dir>]
                 [--depth <depth>] [--[no-]single-branch] [--no-tags]
                 [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
                 [--[no-]remote-submodules] [--jobs <n>] [--sparse]
                 [--filter=<filter>] [--] <repository>
                 [<directory>]

예를 들어

$ git clone https://git.savannah.gnu.org/git/bash.git blahblah
Cloning into 'blahblah'...

관련 정보