refactoring 브랜치로 체크아웃 해서 작업하려고 git checkout refactoring 명령어를 입력하니, 다음과 같은 에러메세지를 마주했다.
error: pathspec 'refactoring' did not match any file(s) known to git
해당 에러는 로컬 저장소의 git과 리모트 저장소의 git 정보가 동기화 되지 않아서, 새로 만들어진 리모트 저장소 브랜치를 참조할 수 없기에 발생하는 에러다.
그러므로 아래 명령어로 원격 브랜치를 업데이트 한 뒤 checkout을 실행하면 잘 동작한다!
git remote update
git checkout 브랜치명
git remote update : 모든 원격 브랜치를 업데이트하여 최신 상태로 갱신한다. 하지만 로컬 저장소에서 변동사항을 병합(merge)하지 않는다.
Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git
I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * d...
stackoverflow.com
git 의 working flow
git init
git add .
git commit -m 'message'
git remote -v
git remote add origin 주소
git remote -v
처음푸쉬할 시
git push --set-upstream origin master
'git' 카테고리의 다른 글
reset --hard로 삭제한 커밋 git reflog를 이용해 살리기 (0) | 2023.08.03 |
---|---|
github 자주쓰이는 명령어 정리 (0) | 2023.07.13 |