앞으로 github를 이용하여 많은 팀 프로젝트를 진행할 것이다.
그렇기에 햇갈리지 않고자 이곳에 내용을 정리한다.
내용은 내가 팀장이라는 가정을 하고 진행한다.
이곳이 앞으로 프로젝트가 진행 될 폴더이다.
터미널 단축키: CTRL + SHIFT + ~
현재 위치 확인: pwd
git 저장소 생성: git init
숨은 폴더 확인: ls -a
파일 생성: touch 파일명.확장자
수정된 파일 확인: git status
저장할 파일 선택: git add 파일명 or git add .
선택한 파일 저장: git commit -m 남길 내용
해당 하는 하단의 코드를 터미널에 붙여넣는다.
init 전에 연결: …or create a new repository on the command line
init 후에 연결: …or push an existing repository from the command line
branch 확인: git branch
branch 생성 및 이동: git switch -c 브랜치명
해당 branch를 처음 올리는 경우: git push -u origin 브랜치명
작성한 코드를 올리는 경우: git push origin 브랜치명
main은 완성된 파일만 옮겨서 실사용한다.
Repositories -> Settings -> General -> Default branch
Repositories -> Settings -> Branches -> Addclassic branch protection rule
1. Require a pull request before merging: 병합하기 위해선 PR을 진행해야한다.
2. Do not allow bypassing the above settings: 팀장도 PR을 해야만 병합할 수 있다.
Add brach ruleset: branch 상세 설정
Addclassic branch protection rule: 단순 개별 보호
Repositories -> Settings -> Collaboratoirs -> Add people
git clone
git push
branch 생성 및 이동: git switch -c 브랜치명
PR의 기능
변경사항 받기: git pull origin dev
Pull requests -> New pull request