개발공부

[Github] 소스 코드 버전 관리를 위한Git과 Github 사용법 clone, commit, push 본문

Github

[Github] 소스 코드 버전 관리를 위한Git과 Github 사용법 clone, commit, push

mscha 2022. 5. 19. 17:57

Git 이란?

 - 소스 코드에 대해 버전을 관리해주는 시스템중 하나이다.

 - 여러명이 하나의 프로젝트를 공동으로 작업할 때, 코드를 관리해 주는 시스템이다.

 - Github.com 같은 곳을 이용해 Git을 활용할 수 있다.

 

Github.com 사용법

www.github.com  

 

GitHub: Where the world builds software

GitHub is where over 83 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 feat...

github.com

1. Github.com 에 로그인 한 후 새로운 저장소를 만든다

https://github.com/new

 

GitHub: Where the world builds software

GitHub is where over 83 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 feat...

github.com

 

2. 데스크탑 깃허브를 다운받은 후 본인의 계정과 연동한다.

https://desktop.github.com/

 

GitHub Desktop

Simple collaboration from your desktop

desktop.github.com

 

 

2. 본인의 리포지토리로 이동하여 본인의 로컬 컴퓨터에 클론(Clone) 한다.

1번은 그대로 두고 2번은 본인이 원하는 디렉토리에 저장되도록 지정한다.

 

4. 클론 후  github desktop 을 보면 아래와 같은데  Open in Visual Studio Code 를 클릭한다.

 

이제 github와 비주얼 스튜디오 코드의 연동은 마쳤다.

이제 commit과 push하는 법을 알아보자.

 

commit, push하기

commit

컴퓨터에서 생성, 변경한 파일의 상태 저장

push

commit한 것을 클라우드에 업로드하는 것

아래와 같이 위와같이 비주얼 스튜디오 코드에 새로운 파일을 만들어보자.

왼쪽의 네비게이션바에 3번째것을 클릭하면 아래와 같이 보인다.

messege 칸에는 대략적인 설명을 쓰고 그위에 v표시를 누른다. (commit)

그리고 아래와 같이 나오면 sync Changes를 눌러준다. (push)

 

그후 본인의 리포지토리에 가면 방금 push한 파일이 업로드 된것을 알 수 있다.