.git 폴더가 로컬 저장소(repository).# 로컬 저장소 생성
git init
# 기본 브랜치 이름 변경 (master → main)
git branch -M main
# 로컬 저장소 → 원격 저장소 push
git push -u https://github.com/username/repo.git main
-u: 원격 주소 저장, 이후 git push만 입력해도 가능.# 원격 저장소 주소를 변수(origin)에 저장
git remote add origin https://github.com/username/repo.git
# 변수 확인
git remote -v
# push 시 활용
git push -u origin main
git clone https://github.com/username/repo.git
git init 필요 없음.# .gitignore 예시
*.log
node_modules/
.env
git clone https://github.com/username/repo.git
git clone -b feature-branch https://github.com/username/repo.git
git pull origin main
git fetch + git merge.git push가 불가.git pull → git push 순서로 진행.# 로컬에서 만든 브랜치 push
git push origin feature-branch
git reset --hard + git push -f로 강제 되돌리기 가능하나, 협업 환경에서는 위험.Revert 버튼 사용 시 "되돌리는 commit"이 생성됨.대표적인 방법론: