[Git] 설치, 명령어

조아영·2024년 7월 15일

◼ Git 설치하기

  1. https://git-scm.com/ 접속, Download for Windows or mac를 클릭해 설치를 시작합니다.
  2. Next 버튼 클릭
  3. Next 버튼 클릭
  4. Use Vim (the ubiquitous text editor) as Git’s default editor → Next
  5. Let Git decide → Next
  6. Git from the command line and also from 3rd-party software → Next
  7. Use bundled OpenSSH → Next
  8. Checkout Windows-style, commit Unix-style line endings → Next
  9. Use MinTTY (the default terminal of MSYS2) → Next
  10. Default (fast-forward or merge) → Next
  11. Git Credential Manager → Next
  12. Enable file system caching → Next
  13. 항목 선택X → Install
  14. Launch Git Bash → Finish

◼ 기본 명령어

git clone <github 주소>
복사

git init
초기화, 초기 셋팅

git status
상태 확인

git log
저장 내역 확인

git add
저장할 파일 지정
예시) git add index.html

git add .
내 프로젝트의 변경사항 한 번에 지정

git commit -m "메세지"
실제 저장하는 명령어
예시) git commit -m "index.html 파일 추가"

git push origin <브랜치>
추가로 수정된 코드 반영
예시) git push origin main

git pull
변경사항 가져오기

git switch <브랜치>
<브랜치>으로 이동

git switch -c <브랜치>
<브랜치>생성하고 <브랜치>로 이동

git merge <합칠 브랜치>
현재 브랜치에 <합칠 브랜치>가 합쳐짐

Pull Request
Pull : 당겨서 합치는 것(merge)
Request : 요청하다

0개의 댓글