내 소스코드를 저장(버전 관리)
소스코드 공유
협업하는 공간
Github : 소스코드를 올리는 공간
Git : 소스코드를 내컴퓨터에서 인터넷으로 올려주는 것
gitbash 오픈
유저 이름 설정
git config --global user.name "your_name"
유저 이메일 설정
git config --global user.email "your_email"
정보 확인하기
git config --list
깃을 쓸 준비. 초기화. 맨처음 프로젝트시 무조건 해야.
git init
git add : 어떤 파일을 올릴지 한번 보자 . : 전부 다. 모든 파일을 다 올리겠다.
git add .
(index.html만 올리려면 git add index.html)
어떤 것을 올릴 수 있는지 상태를 알려주는 명령어 (필수는 아님)
git status
히스토리 만들기 (히스토리 이름 first commit)
git commit -m "first commit"
로컬과 github 연결고리 만들기.
new repository on the command line 에서 마지막 윗줄 복사 후 붙여넣기
git remote add origin 리파짓토리주소
연결 잘 됐는지 확인 (필수는 아님)
git remote -v
github로 올리기 (master 맞나?) master 자리에는 branch이름이 들어가면 됨
git push origin master
모든 파일 올리겠다. (.안쓰고 일일이 지정해서 올리는게 안정적)
git add .
상태 확인 (필수x)
git status
히스토리 만들기 (히스토리 이름 second commit. 업데이트 하면서 다른 이름으로 변경)
git commit -m "second commit"
git hub로 올리기
git push origin master
.gitgnore 디렉토리를 만들어 제외시키는 방법이 있었다.