Engineering/Git
[Git] 01 Git Basic
by iamzieun
2023. 4. 4.
Git & Github
- Git: 소프트웨어 버전관리 시스템(VCS, Version Control System)의 한 종류
- Git server & Git client
- git server
- git client
- git server의 사본을 가진 로컬 환경
- ex) git CLI(Command-line interface), Visual Studio Code에 내장되어 있는 git 등
Create Repository
- Repository
- repository: 파일이나 디렉토리(폴더)를 저장하는 장소
- local repository: 자신의 컴퓨터에 있는 repository
- remote repository: 서버 등 네트워크에 있는 repository
기본적으로 local repository에서 작업을 수행 → 그 결과를 remote repository에 저장
Clone Repository
- Clone
- remote repository의 내용을 local repository에 다운로드
- git clone [url]
Git Init
Git Config
Git Add / Commit / Push / Pull / Fetch / Merge
- add / commit / push
- pull / fetch / merge
- pull: ****remote repository의 commit을 local repository에 반영하는 작업
- fetch: remote repository의 commit을 local repository로 가져오는 작업
- merge: 두 branch를 병합
Head
- 새로 만들어진 commit은 head가 가리킨다.
- head가 가리키는 commit이 새로 만들어진 commit의 부모이다
- head는 working directory와 stage area가 어떤 버전인지 알려준다
- checkout은 head를 바꾼다.
Git Remote
- remote: remote repository를 조작하는 기능
- 현재 프로젝트의 remote repository 목록 표시
git remote
git remote add <이름> <url>
git remote rm <이름>
댓글