본문 바로가기
카테고리 없음

Git push, clone 등 정리

by eden.do 2022. 9. 30.

 

Git 특정 브랜치만 clone

git clone -b {branch_name} --single-branch {저장소 URL} ex) git clone -b javajigi --single-branch https://github.com/javajigi/java-racingcar

 

[출처] https://www.slipp.net/questions/577

 

Git 브랜치 삭제

git branch -d {브랜치명} ///// local

git push origin --delete {브랜치명} //// 원격

 

[출처] https://ifuwanna.tistory.com/284

 

git commit & push 방법

#git commit하는 사용자 정보 추가
git config --global user.name "xxx.xx"
git config --global user.email "xxx.xx@xxxxxx.xxx"
#git staging 영역 추가
git add [추가하려는 파일]
#add 내역 확인
git status
#git commit
git commit -m "[메시지 내용]"
#원격 저장소 연결
git remote add origin [원격 저장소 github URL]
#git push
git push origin master

Git 브랜치 push

https://powerofsummary.tistory.com/123

Git add 취소

https://gmlwjd9405.github.io/2018/05/25/git-add-cancle.html