clone
주소 카피
터미널에서 적절한 디렉토리에 들어가서
git clone 주소 붙여넣기
cd clone 폴더에 들어가기
npm install
git branch feature/sumin
git checkout feature/sumin
수정
npm start
git add .
git commit -m "수정내용"
git push origin feature/sumin
git page에서 PR하기
용현 notion 참고
https://421ee.notion.site/0915-Westagram-React-Kickoff-681a31f5912a4fab9ab6c4b4df1d0897
비쥬얼 에서 git hub 로 올리기
westagram폴더까지 진입
git add .
git status
git commit -m "내용"
git push origin feature/sumin25 // 리무트의 공간으로 저장
pull
마스터 브랜치에서
git pull origin master
merge
git chekout master
git merge 브랜치명
충돌
git checkout master 마스터로 체크아웃
git pull origin master
git checkout feature/ 충돌난 브랜치
git merge master
- 충돌해결
git dda .
git commit -m ""
git push origin feature/- 충돌해결(rebase)
git add .
git rebase --continue
:q
git push origin feature/브랜치명 -f (강제푸쉬 & 덮어쓰기)
wecode
폴더로 이동cd Desktop/wecode
git_practice
폴더 생성mkdir git_practice
git init
git_practice
폴더 진입 후 (cd git_practice
).git
폴더 확인 (ls -al
)본인영문이름.md
파일 생성touch seunghyunson.md
vi seunghyunson.md
git status
wq: 저장
shift + : wq + enter
vi: 에디터
qa || a! : 강제종료
git add .
git status
git commit -m "메세지"
git status
git log
git_practice
폴더와 github repository 연동git remote add origin 레파지토리주소
git remote-> origin 출력되면 정상
git branch -> * master 정상
git push origin main/master
삭제해도 남아있는 경우
- 모든 브랜치 목록 확인
$ git branch -al- 로컬과 원격 브랜치 동기화
$ git fetch --all --prune- 브랜치 삭제
$ git branch -d 브랜치명
로컬에서 저장소 초기화하고 GitHub 저장소에 푸시하기
git init
git add .
git commit -m "first commit"
git branch -M main // main으로 브랜치명 변경(선택)
git remote add origin 깃허브주소
git push origin main
remote 지우고 다시 clone 하기
rm -rf ./.git 깃 프로젝트 해제
git remote -v remote 있는지 확인
git remote remove origin 있으면 다시 지우기
git remote -v remote 재확인
git init git 초기화
새로 clone
-avv
- a: all, v: 자세히, v: 더 자세히
- ex) git branch -av
- git branch -avv
branch
- git branch -t origin/feature/dashboard
새로운 브랜치로 만들어주고, 원격 저장소에 있는 해당 브랜치와 동기화 시켜준다
- 브랜치명 변경하기
$ git branch -m OLDBRANCH NEWBRANCH- 브랜치 작성과 체크아웃을 한꺼번에 실행
$ git checkout -b 브랜치명- 브랜치 삭제
$ git branch -d 브랜치명