1. 레포지토리 default branch를 master에서 main으로 변경하는 법

git branch -m master main
git push -u origin main


2. 폴더에 새로 만든 레포지토리 주소 연결하는 방법

git remote add origin 깃허브주소

 

3. 이미 레포지토리가 존재하는 경우에 레포지토리 주소 변경하는 방법

git remote set-url origin 깃주소

 

4. 이미 push 된 파일에 .gitignore 적용

git rm -r --cached .
git add .
git commit -m "chore: apply .gitignore"
git push origin main

 

5. 만든 브랜치명 변경하기

git branch -m [OLD_BRANCH] [NEW_BRANCH]
728x90

+ Recent posts