Git과 Github

Henry Lee·2020년 12월 14일
0

왜 깃?

같이 일해야 하니까.. (협업)
분산버전관리sys

Commands

local

# 초기화
> git init

# 상태
> git status

# unstaged -> stage
> git add "example.py"
> git add .

# commit
> git commit -m "summary"

# commit 확인
>git log

# branch 확인
>git branch -v

# branch 생성
>git branch <branch_name>

# branch 전환
>git checkout <branch_name>

# brnach 병합
>git checkout master
>git merge <branch_name>

# branch 삭제
>git branch -d <branch_name>

remote (진짜 협업!)

# 연결
>git remote add <별칭=origin> <remote주소>

# remote 확인
> git remote -v

# push
> git push <remote_repo_name> <branch_name>
> git push origin week3/이현규

# remote branch_name을 main으로 변경 (github 정책상 유용)
> git branch -M main
> git push origin main

과제제출방법

당장은 이거 잘하려고 깃 배움. 장기적으로는 업무 편의성(?)

1. Fork (내 github으로 가져오기 - 복사 -)

# local에 clone
> git clone <주소> <별칭=repo_name>

# branch 생성 & 전환
> git branch week3/이현규
> git checkout week3/이현규

2. Push

  • '/' 포함 branch명('week3/이현규')으로 push할때 에러O
  • '/' 제외 branch명('week3이현규')으로 push할때 에러X

3. Pull

  • 제목은 "[3주차]이현규" 필
  • base & compare 유의!
profile
Today I Learned. AI Engineer.

0개의 댓글