Dev/Git

Git 간단한 사용법 - Clone

Itips 2019. 6. 19. 21:24
반응형

Git 간단한 사용법 - Init 에서 기본 저장소 초기화 및 편리한 프롬프트 설정까지 설명하였다.  

다음은 다른 장소에서 이 변경사항을 가져와서 작업하는 방법을 설명한다.

 

1. 이전에 생성했던 there 리포지토리 외부에서 시작(어디에서 해도 상관은 없다)

[~] $ ls -l
total 4
drwxrwxr-x. 3 itips itips 4096 Jun 19 21:28 there

2. git clone 명령으로 there 리포지토리를 here 이름의 로컬 디렉토리로 복제한다. 

[~] $ git clone there here
Cloning into 'here'...
warning: You appear to have cloned an empty repository.
done.

3. 생성된 디렉토리 확인 및 이동 - 프롬프트가 현재 master 브렌치로 체크아웃 되어 있음을 보여준다.

[~] $ ls -l
total 8
drwxrwxr-x. 3 itips itips 4096 Jun 19 22:10 here
drwxrwxr-x. 3 itips itips 4096 Jun 19 21:28 there
[~] $ cd here
[~/here] (master) $ 

4. 현재 상황 확인 및 git log 로 변경 사항 히스토리 확인

[~/here] (master) $ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)
[~/here] (master) $ git log
fatal: your current branch 'master' does not have any commits yet

5. 현재 git repository 의 원격 remote repository 확인

[~/here] (master) $ git remote -v
origin	/home/itips/there (fetch)
origin	/home/itips/there (push)

 

 

반응형