본문 바로가기

이거슨 상식!

git 관리...

# 원격 브랜치 삭제 

git push origin -d clothes

 

# branch 만들고, 이동

git checkout -b clothes

 

# 올릴 파일 리스트 업데이트 

git add * 

 

# 올릴 파일들에 대한 코멘트 

git commit -m "revised list"

 

# 원격지에 올리기

git push 

 

# 원격지에서 변경내역 받아오기 

git pull

 

# 원격지랑 다른게 있어서 에러 뜰 때

1) 로컬에 있던 변경 내용을 잠깐 stash에 옮긴다.   :  git stash 

2) 이제 원격지 내용을 가져온다 : git pull  

3.1 ) 필요없는거면 그냥 버린다 : git stash drop 

3.2 ) stash 에 옮겼던거 덮어쓴다 : git stash pop

 

# git commit 취소

$ git reset HEAD^ // 위와 동일
$ git reset HEAD~2 // 마지막 2개의 commit을 취소
https://gmlwjd9405.github.io/2018/05/25/git-add-cancle.html

 

 

# 특정 브랜치만 pull 하기 

git pull origin <branch name>  

 

# 특정 브랜치만 clone 하기

git clone  -b {branch_name} --single-branch {저장소 url}

 

# 특정 브랜치 이름 변경

 git branch -m 원본브랜치 바뀐이름

 

# 관리 파일 삭제

git rm --cached -r Paint-by-Example   (원격지에서 삭제) 

git rm: 로컬과 원격 저장소 모두에서 파일 혹은 경로 삭제

 

# 원격 저장소에서만 삭제

1) git rm --cached b.txt
2) git commit -m "텍스트"
3) git push master "branch 이름"

 

# 원격 저장소 변경

git remote set-url origin <새로운GITURL>

 

 

error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.

위 에러 발생시 아래 구문 셋팅 (http 캐싱에 충분치 않음?)

git config --global http.postBuffer 524288000

git config --global http.postBuffer 1048576000

git config --global http.sslVerify false

* tip : 파일이 클 경우 git lfs install은 꼭 해주고 시작하자.