본문 바로가기
강의/패스트캠퍼스 0원 챌린지

패스트캠퍼스 챌린지 24일차 - Part 2. 버전 관리 (1)

by 로또 2023. 3. 15.

이번 챕터에서는 Git을 활용한 버전 관리에 대해 배우게 됐다.

1. 개요(Git, GitHub)

Git

컴퓨터 파일의 변경사항을 추적하고 여러 사용자들 간에 해당 파일 작업을 조율하기 위한 대표적인 버전 관리 시스템(VCS)

  • git 버전 확인 터미널 명령어 (Mac)
$ git --version

나는 이미 다운 받은 상태여서 버전 결과가 보여졌다. 다운 받지 않은 상태에서는 git 홈페이지에서 다운로드 받을 수 있다.

Git - Downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

GitHub

GitHub: Let’s build from here

 

GitHub: Let’s build from here

GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and fea...

github.com

2. 스타벅스 예제 GitHub 업로드 (Push)

VS Code 내부 터미널 열기

  1. 상단바 - Terminal - New Terminal
  2. 아래쪽 상태바에 커서 올려서 화살표 모양으로 바뀌면 끌어올리기

* 터미널 경로가 프로젝트와 일치하는 지 확인하기!

VS Code 내부 Terminal

$ git init
// master라고 뜸

$ git config --global core.autocrlf input
$ git config --global user.name '사용자이름'
$ git config --global user.name '이메일주소'
// git 사용 전 한번만 하면 됨

$ git config --global --list

$ git status // 현재 상태 확인

$ git add . // 버전 관리를 하겠단 의미로 추가
$ git status

$ git commit -m '커밋메세지'
$ git log // 커밋메세지 확인

GitHub에서 repository 생성 후 원격 주소 복사

$ git remote add origin 레포지토리주소
// 원격 주소의 이름을 origin으로 생성할 것

$ git push origin master
// 방금 저장한 원격 주소의 master라는 브랜치에 push
  • github 로그인 후 인증하기

이런 절차를 거치면 GitHub에 작성한 Starbucks 코드가 올라간다!

빈 레포지토리에서 push 후 코드가 올라간 모습

 

http://bit.ly/3Y34pE0

 

패스트캠퍼스 [직장인 실무교육]

프로그래밍, 영상편집, UX/UI, 마케팅, 데이터 분석, 엑셀강의, The RED, 국비지원, 기업교육, 서비스 제공.

fastcampus.co.kr

본 포스팅은 패스트캠퍼스 환급 챌린지 참여를 위해 작성되었습니다.

댓글