프로젝트에서 필수적으로 쓰이는 Git의 기본중 기본만 알아보자
git config --global user.name "(이름)"
git config --global user.email "(이메일)"
전역으로 user.name ,user.email 을 설정한다.
잘 설정이 되었는지 확인하는 방법은
git config --global user.name
git config --global user.email
을 통해 확인 할 수 있다.
git init
원하는 폴더로 이동하여 git init이라는 코드를 통해 Git을 시작할 수 있다.
git status
git status를 통해 Git의 상태를 확인 할 수 있다.
git add (파일명.확장자)
git add .
git commit -m "커밋할 이름"
git log
git branch (브런치이름)
git branch
git switch (브럼치이름)
git branch -d (삭제할 브랜치 명)
git branch -m (기존 브랜치명) (새 브랜치명)
git remote
git remote remove (origin 등 원격 이름)
로컬환경의 연결만 없애고 GitHub의 Repository는 지워지지 않는다.
git clone (원격 저장소 주소)
git push -u origin main
git pull -u origin main
git push --force