본문 바로가기

I_TStory/GIT

[Github 사용법 A to Z] 0_Git 시작하기 (회원가입, 토큰설정, GIT 설치, 로컬 저장소 생성)

해당 챕터에서는 Github 계정을 생성하고 git init으로 로컬저장소를 생성하는 방법을 설명합니다.

 

📌 Github 회원가입

https://github.com

 

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


📌 토큰 만들기

로그인 후 상단 프로필 클릭 -> Settings -> 왼쪽 메뉴 가장 하단의 Developer settings 선택

 


Personal access tokens -> Tokens (classic) 선택 ->  Generate new token 버튼 클릭 ->  Generate new token (classic) 선택

 


Note에 이름, Expiration은 만료일 없음으로 설정


Select scopes 체크박스 전체 선택으로 내 계정의 모든 권한을 허용해준다 (읽기, 쓰기, 삭제 등)

 

Generate Token을 누르면 토큰이 만들어지는데 복사하기 버튼 클릭해서 토큰은 저장해둔다.

❗️ 토큰은 다시 볼 수 없으니까 메모장에 꼭 저장해두기 

 


📌 Git 다운로드

https://git-scm.com/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

 


터미널에서 git 치고 아래와 같은 설명 나오면 잘 설치된 것임

 


 

📌 로컬 저장소 만들기

VSCode 를 열고 바탕화면에 git_study 폴더를 생성하여 README.txt 파일을 생성해줍니다.

업로드 테스트용이니 아무말이나 적어줍니다.

터미널을 켜고

cd Desktop/git_study 입력하여 깃스터디 폴더로 접근해줍니다.

git init 을 입력합니다.

 

이렇게 git init을 입력해주면 이제 git_study 폴더에 .git 파일이 생기는데 폴더를 들어가서 보면 아무것도 안보이죠?

해당폴더에서 command + shift + . 단축키를 입력하면

짠 요렇게 숨겨진 .git 파일이 보입니다.

.git  폴더 = 로컬저장소 (대입연산자 아니고 이꼴 입니다 ㅎ)

즉, .git 폴더가 로컬저장소와 같은 의미입니다.

 

여기까지 git int 명령으로 Git 초기화 과정을 마쳤고요, 이제부터 이 폴더에서 버전 관리를 할 수 있습니다.

다음챕터에서 만나요.