[Git] Commands

ShiHoon Yoon·2020년 9월 10일
0

Git 중간 시험

문제 1

1) git init

2) vi practice.js

3) i to insert

4) ESC button then :wq

5) git add .

6) git commit -m "first commmit:

7) git branch

8) git remote add origin https://github.com/syoon285/practice1.git

9) git push origin master

문제 2

1) git checkout -b feature/readme

2) git branch

3) vi file name

4) i insert information

5) ESC button :wq to save

6) git add filename

6) git commit -m "add README.md"

7) git push origin feature/beta

Group Git Command

✏️ 작업 순서 (git)
1. 초기 세팅된 git repository clone하기
git clone https://github.com/wecode-bootcamp-korea/11-React-Westagram-1.git

  1. master branch에서 자신만의 브랜치 만들고 checkout하기
    git branch feature/자기 이름
    git checkout feature/자기 이름

  2. 자기 브랜치에서만 작업하기(Master 건들이지 않기!)

  3. 작업 완료 후에 바로 add commit push를 하는 게 아니라 github을 확인한 후 master 브랜치가 update되었는지 확인하기(update가 되었다면 5번부터 읽기, 안되었다면 8번부터 읽기)

  4. 만약 master 브랜치가 update되었다면(혹시나 혹시나 common.scss가 update되었다면?!) master 브랜치로 checkout하기
    git checkout master

  5. update된 코드 다운로드 받기
    git pull origin master

  6. feature/자기이름 브랜치로 다시 이동해서 master branch merge하기
    git checkout feature/자기 이름
    git merge master

  7. 자기 코드에 이상이 없는지 확인 후에 add, commit, push 하기
    git add .
    git commit -m "[자기 이름] ADD : 적용된 내용"
    git push origin feature/자기 이름

  8. github에서 PR(Pull Request) 보내기

  9. 다시 3번부터 무한 반복...

profile
Entrepreneurs Should Learn to Code

0개의 댓글