![](https://velog.velcdn.com/images%2Fturtle601%2Fpost%2Ff19d305c-1307-4bfb-b929-dd1d11706e3d%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-09-23%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%207.31.32.png)
2021 GDSC React Study
❗ Git 규칙
- master 브랜치에서 작업하지 마세요
(자신의 이름으로 된 브랜치인지 수시로 확인해주기)
- 자신의 이름으로 된 폴더를 만들고 그 안에서만 작업하기
(merge 충돌 방지)
🚩 Git 사용법
(Git을 잘 알더라도 꼭 읽어보세요!!)
1. Fork하기
- 해당 링크(https://github.com/turtle601/GDSC_React_Study)에 들어가서 Fork 버튼을 누른다.
![fork1](https://user-images.githubusercontent.com/90830490/133703038-fa4e7a05-b8ab-4277-b754-48d884669b27.PNG)
- 자신이 깃허브로 들어가 Fork 되었는지 확인하기
![fork2](https://user-images.githubusercontent.com/90830490/133703728-367e1b59-8a63-41ad-8704-d8b070618840.PNG)
- mung89 는 부계정입니다. (스터디원 각자의 계정이라고 생각하시면 됩니다.)
2. git clone 하기
- 저장소 url을 아래 버튼을 눌러 복사합니다.
![clone1](https://user-images.githubusercontent.com/90830490/133704528-bc4ceb5d-9d7b-4b48-a01e-593387282a66.PNG)
- 내가 작업하고자 하는 환경에 아래와 같이 입력한다.
git config --global user.name 깃허브아이디
git config --global user.email 깃허브연동이메일
git clone [복사한 저장소 url]
![clone2](https://user-images.githubusercontent.com/90830490/133704866-0377cbb8-00fe-4871-a467-00e563d4c5f3.PNG)
3. 브랜치 생성 및 변경
- 내가 클론한 폴더로 이동
cd GDSC_React_Study
- 브랜치 생성 및 변경
브랜치 명은 영어로 된 자신의 이름으로
git checkout -b [자신의 이름 두 글자 영어로]
![branch](https://user-images.githubusercontent.com/90830490/133706049-3a69ccd9-d7a1-43d4-a71a-22d298686e8c.PNG)
- 브랜치 확인하기
자신이 지금 어떤 브랜치에 있는지 알려준다.
git branch
![branch2](https://user-images.githubusercontent.com/90830490/133706518-14c9f02b-b143-4abd-9384-8fe60d06a82c.PNG)
4. add ,commit ,push
- ✨ 자신의 이름으로 된 폴더 생성하기 ✨
![folder1](https://user-images.githubusercontent.com/90830490/133706986-e93fc20d-1297-4567-a8b7-31e000317109.PNG)
이 안에서 파일 생성 및 각자 프로젝트 코드를 작업하시고
add, commit push를 해주세요!!
Ex) Jaeseok 폴더 안에 test.txt 만들어서 add,commit, push 해보기
- add
git add 폴더 및 파일 명
![add](https://user-images.githubusercontent.com/90830490/133708098-3db7050d-395a-4323-b896-88d4f2f30a91.PNG)
- commit
git commit -m "[자신의 이름] 커밋메시지 작성
![commit](https://user-images.githubusercontent.com/90830490/133708127-aa8bb5a5-f6ab-4bf4-abad-1983052fa187.PNG)
- ✨ push ✨
git push origin 자신의 이름으로 된 branch 명
![push](https://user-images.githubusercontent.com/90830490/133708168-c279a932-6f59-4cc2-99bf-1829146a1af1.PNG)
- 확인하기
![check](https://user-images.githubusercontent.com/90830490/133709215-b879cc10-b434-43c9-be3f-14494d541390.PNG)
5. Pull Request 보내기
- 이렇게 PUSH 까지 마치면 내 깃허브 계정이 다음과 같이 뜬다.
![pull request 1](https://user-images.githubusercontent.com/90830490/133708462-22b645a7-46ca-43d2-b6bd-98dc6299ab43.PNG)
- 안 뜨면 여기서 클릭
![](https://velog.velcdn.com/images%2Fmung89%2Fpost%2F4d5aa9f2-9de6-416c-8d6d-cbe93cbe37cd%2F%EB%A7%88%EC%A7%80%EB%A7%89.PNG)
- 받는 사람과 보내는 사람을 정해서 보낸다.
![pull request 2](https://user-images.githubusercontent.com/90830490/133709714-7487fbfb-8f32-4f5f-910f-ea8c7584c98b.PNG)
- 자신의 이름으로 된 폴더, 자신의 이름으로 된 브랜치 내에서만 작업을 했다면 다음과 같이 뜰 겁니다. (성공)
![pull request 성공](https://user-images.githubusercontent.com/90830490/133711702-87b54aa6-40bd-444b-85ba-b9ab301ece02.PNG)