본문 바로가기

개발/기타

[GIT] 터미널(Command) 명령어

반응형

GIT 추적 지우기

DS_Store 추적 지우기

git rm —cached -f *.DS_Store
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

 

UserInterfaceState.xcuserstate 추적 지우기

git rm --cache */UserInterfaceState.xcuserstate

 


 

GIT 프로젝트 연결하기

git remote set-url origin 깃주소

 


 

GIT 커밋 취소 

가장 최근의 커밋을 취소하기

git reset HEAD^

특정 commit id로 되돌리기

git reset --hard commitID 
// ex.) git reset --hard e35871e

 

원격 저장소에 강제 push 하기

git push origin +branchName

 


 

GIT Branch

브랜치 이동

git checkout 브랜치명
// git checkout master
// git checkout develop
// git checkout feature/example

 

원격 브랜치 생성하기

// 1. 로컬 브랜치 생성
git checkout -b feature/a

// 2. 원격 브랜치 생성
git push origin feature/a

// 3. 로컬과 원격 브랜치 연동
git branch --set-upstream-to origin/feature/a

 

원격 브랜치 삭제하기

// 1. 로컬 브랜치 삭제  
git branch -d 브랜치명

// 2. 원격 브랜치 삭제
git push origin :브랜치명

// 합병 안하고 삭제 시
git branch -D 브랜치명

 

원격 브랜치 업데이트

git remote update

 


Pod 

Pod 삭제하기

sudo rm Podfile.lock
sudo rm -r 프로젝트명.xcworkspace
sudo rm -r Pods
반응형