Git 활용방법
1. git 설치
2.git 아이디 비밀번호 설정
$ git config --global user.name "kimcoding" $ git config --global user.email "kimcoding@example.com"
3. 텍스트를 nano로 진행
$ git config --global user.name "kimcoding" $ git config --global user.email "kimcoding@example.com"
4. 디랙토리에 git 설치
Local 과 github 연결
1.. 로컬 저장소를 가상 저장소에 연결
a.git remote add origin 주소 or
b.친구 저장소에 연결은 git remote add 친구이름 주소
2.. 로컬 저장소에 잘 들어갔는지 확인
git remote -v
3.다른 사람 저장소에 연결하기
git remote add 'name' 주소
4. Local 에서의 할 일
4.0 git init -> git status
4.1. git add index.js
4.2. commit (사진찍는 느낌) git commit -m '메세지'
4.3. 예외 restore :commit 후 취소하기 or git HEAD~1
5.가상 저장소에 넣고 빼기
pull push
git pull name master(or main) git push name master(내꺼일 경우 git push origin master)
Local 에서의 할 일
기타
git log :commit 기록을 볼 수 있음.
Unmodified : 기존에 Commit했던 파일을 수정하지 않은 상태입니다.
Modified : 기존에 Commit했던 파일을 수정한 상태입니다.
Staged : commit이 가능한 상태입니다. 수정한 파일을 commit 하기 위해서는 staged area에 add 하는 작업이 필요합니다.
'코드스테이츠' 카테고리의 다른 글
객체 (0) | 2021.08.02 |
---|---|
코드스테이츠 2주차 배열 (0) | 2021.07.30 |
코드스테이츠 2주차 querySelector ,CLI (0) | 2021.07.26 |
코드스테이츠 1주차 HTML (0) | 2021.07.23 |
코드스테이츠 1주차 (0) | 2021.07.20 |