git 명령어.
==============================
소스 제어.
==============================
- 빈커밋.
git commit --allow-empty -m {msg}
==============================
브랜치, 리모트.
==============================
- 현재 로컬 브랜치를 master에서 main으로 이름만 변경.
git branch --show-current & git status --short --branch
git branch -M main
- 리모트 저장소 조회.
git remote -v
- 리모트 저장소 추가.
git remote add origin ssh://사용자명@NAS_IP/volume1/git/myapp.git
- 리모트 저장소 제거.
git remote set-url origin ssh://dolcoco@192.168.219.200/volume1/git/MusicFolderPlayer.git
- 로컬에서 개발하다, 리모트 저장소를 만들고, 리모트 저장소를 추가 했을때, 로컬 코드로 덮어씌움.
git push -u origin main
==============================
글로벌.
==============================
- git 업데이트.
git update-git-for-windows
- 기본 브랜치가 main으로 생성되게 하는 전역 Git 설정.
git config --global init.defaultBranch main
git config --global --get init.defaultBranch
댓글
댓글 쓰기