바뀜

이동: 둘러보기, 검색

Git

1,005 바이트 추가됨, 2022년 2월 7일 (월) 05:44
편집 요약 없음
== clone ==
새로운 디렉토리에 다른 repository를 복제한다.
 
== init ==
clone과 함께 git저장소를 만든다.
 
이 명령은 .git 이라는 하위 디렉토리를 만든다. .git 디렉토리에는 저장소에 필요한 뼈대 파일(Skeleton)이 들어 있다. 이 명령만으로는 아직 프로젝트의 어떤 파일도 관리하지 않는다.
 
Git이 파일을 관리하게 하려면 저장소에 파일을 추가하고 커밋해야 한다. git add 명령으로 파일을 추가하고 git commit 명령으로 커밋한다:<syntaxhighlight lang="bash">
$ git init
$ git add *.c
$ git commit
</syntaxhighlight>
 
== remote ==
<syntaxhighlight lang="bash">
$ git remote -v
origin https://github.com/schacon/ticgit (fetch)
origin https://github.com/schacon/ticgit (push)
</syntaxhighlight>git clone명령은 암시적으로 원격 저장소를 추가한다. 명시적으로 하려면 다음과 같다.<syntaxhighlight lang="bash">
$ git remote add <shortname> <url>
</syntaxhighlight>'origin'은 git이 복제한 서버에 부여하는 기본이름이다.
== pull ==
편집
2,440

둘러보기 메뉴