[우아한테크코스] 7월 6일 TIL

less than 1 minute read

[Git] 브랜치 전략

  • Feature Branch
    git branch feature/hi 기능 브랜치에서 작업
  • Hotfix Branch
    git checkout -b hotfix/what feature 브랜치에서 main 브랜치로 전환하고 hotfix/what
  • 태그 추가
    git tag -a v0.1 -m “최초 배포 버전”
    태그 조회: git show v0.1
    git push origin v0.1:v0.1
  • Release note 작성

[Git] 리모트에서 브랜치 이름 바꿔졌을 때 설정

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

[Git] 커밋에 쌓인 캐시 삭제

git rm -r –cached .
git add .
git commit -m “Fix untracked files”