본문 바로가기

코딩

GitHub와 Git

728x90

github: 소스코드올리는 공간 ,클라우드 제공자(gitlab, bitbucket)

git: 소스코드를 내컴퓨터에서 인터넷으로 올려주는 역할 

 

1.같은 파일의 다른버전을 관리하고 보관할 수있다.

2.소스코드를 공유

3.협업시 여러명이서 충돌없이 사용가능

 


Git 설치와 환경설정

선행 되어야할 것 : github 회원가입,  repository  생성

1.Git 설치 후 Git Bash열기

2.유저이름 설정

git config --global user.name "your_name"    // your_name에 본인의 이름

 

3.유저 이메일 설정

git config --global user.email "your_email"   // your_email에 Github 가입시 사용한 이메일

4.정보확인하기 

git config --list 

타이핑 후 나오는 유저이름과 이메일 맞는지 확인

 

Github에 소스코드 업로드하기

1.초기화

git init  //프로젝트 처음 생성 시만 적용

2.추가할 파일 

git add .

add . -->모든 파일을 업로드 하겠다는 의미

git add index.html  --> index.html을 업로드 하겠다는 의미 (선택적으로 올리기)

 

3.상태확인 

git status

4.히스토리 만들기 

git commit -m "first commit"

-m --> message의 약어

 

5.Github repository랑 내 로컬 프로젝트랑 연결

git remote add origin https://github.com/UHyun-K/fistpoject.githttps://github.com/bitnaGithub/firstproject.git

아래 드래그한 명령어를 그대로 복붙 한 것

6.연결주소확인 

git remote -v

7.Github로 올리기

git push orgin master // master자리에 branch 이름 작성

Github에 파일  업데이트하기 

1.추가할 파일 더하기

git add .

2.히스토리 만들기

git commit -m "second commit"

3.Github 올리기

git push origin master

 

'코딩' 카테고리의 다른 글

github Desktop 이용법 /static website hosting  (0) 2021.10.13
SPA(Single Page Application)  (0) 2021.10.06
API역할과 유형  (0) 2021.10.04
토큰과 파싱  (0) 2021.10.04
TWEENMAX  (0) 2021.06.25