Github를 사용해보기 위해 책까지 샀지만, 뭔가를 배우면 바로 까먹는 나를 위해 쓰는 글이다.
개념도 어느정도 알지만 헷갈리니까 다시 정리한다.
처음부터 시작하는 Github 사용법
1. Github에서 Repository 만들기
2. 로컬 저장소에서의 파일 작성, 편집
3. 파일 생성
Git Repository 만들기
1. 사이트에 로그인하자 - https://github.com/
GitHub: Where the world builds software
GitHub is where over 65 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. 새로운 Repository를 만든다.
Git
설치
- Git 설치 : https://gitforwindows.org/
Git for Windows
Git for Windows focuses on offering a lightweight, native set of tools that bring the full feature set of the Git SCM to Windows while providing appropriate user interfaces for experienced Git users and novices alike. Git BASH Git for Windows provides a BA
gitforwindows.org
설치했으면 윈도우에서 Git Bash를 검색하여 실행한다.
사용
Git을 사용하기 위해서 유저 정보, 이메일을 반드시 설정해야한다.
1
2
3
4
5
6
7
|
# Git 초기 정보 구성
$ git config --global user.name "Your Name"
$ git config --global user.email "youemail@company.com"
$ git config --global core.editor vim
# Git config 상태 표시
$ git config --list
|
cs |
git clone
git clone은 <URL>에 위치한 Remote git을 Local git으로 복제하는 것이다.
Github에서 복제하고 싶은 Repository의 주소를 찾아 복제한다.
git add
소스코드를 만들고 저장한다.
git add 후에 git state 를 확인해보면 stage된 파일 리스트를 확인할 수 있다.
git Commit
stage 된 파일을 commit 한다.
git push
로컬 저장소에 있는 commit을 원격 저장소에 반영한다.
Github에는 ID와 Password를 입력하면 반영된다.
git log
수정 내역을 확인할 수 있다.