git
github
- repository : 저장소
- local : 자신의 컴퓨터
- origin : 원격 저장소(깃허브 페이지)
<aside> 🖥️ Repository 복제 방법 2가지
fork : 다른 사람의 respository → 내 github repsoitory로 그대로 복제
clone : : 다른 사람의 respository ⇒ local로 복제해서 새로운 저장소 만들기
</aside>
<aside> ✔️ Github 설정
homebrew, git 설치
git config 설정
git config —global [user.name](<http://user.name>) “이름”
git config —global [user.email](<http://user.email>) “이메일”
git config —list
git clone “레포 주소 링크”
새로운 레포 생성 public/private, gitignore 설정 가능
git status
git add 파일명
: 깃에 파일 추가
git commit
vi 창 (command mode) - commit 메세지 작성 후 커밋 가능
i
- insert esc
:wq
enter
> git commit -m "커밋메시지"
# vim 편집기화면을 건너뛰고 한줄짜리 메시지와 함께 곧바로 커밋할 수 있음
> git commit --ammend
# 방금 전 올린 commit message를 수정할 수 있음
git push
: 서버에 넣음
git pull
: 서버의 변경사항을 내 pc에 적용
다 하고 status 보면 nothing to commit, working tree clean
파일 내용 변경 있으면 다시 git add 하고 푸시 </aside>
<aside> ❗ repo 꼬였을 때
git remote add origin <https://github.com/hufs-mobile/Props_201904385.git>
# 에러나면 git remote remove origin 하고 다시
git branch -M main
git push -u origin main
✅ 에러나서 git add 하고 커밋 하고 다시 푸시!
git add .
git commit -m "커밋 메세지 작성"
git push -u origin main
</aside>
Go live
다른 디렉토리에서 열면 css 및 이미지 적용이 안됨 ❗️❗️❗️
브랜치를 통해서 하나의 프로젝트를 여러 갈래로 나누어서 관리 및 개발 가능