까뮈_b
까뮈의 개발 노트
까뮈_b
전체 방문자
오늘
어제
  • 분류 전체보기 (23)
    • JAVA (0)
    • Spring (4)
    • JPA (1)
    • JavaScript (1)
    • DB (0)
      • Mysql (0)
    • Tools (4)
      • IntelliJ (2)
      • WebStorm (1)
      • Flyway (1)
    • 에러노트 (2)
    • 생각노트 (1)
    • Git (4)
    • HTML&CSS (1)
    • Laravel (2)
    • AWS (3)
    • Server (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 구조 분해 할당
  • start.spring.io
  • DBEngineVersion
  • Amzone Linux AMI 2
  • 111: Connection refused
  • 무중단배포
  • webstorm keymap
  • ElasticBeanstalk 버그
  • AWS
  • spring
  • Non-ASCII Characters
  • netstat
  • 리버스 프록시 서버
  • 컴포넌트 스캔
  • componentscan
  • 의존관계 주입
  • 502 Bad Gateway
  • EC2 호스트네임 변경
  • AWS ElasticBeanstalk
  • ElasticBeanstalk

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
까뮈_b

까뮈의 개발 노트

[git] 새로 만든 원격 브랜치로 checkout이 안될 때. - error: pathspec did not match any file(s) known to git 해결법
Git

[git] 새로 만든 원격 브랜치로 checkout이 안될 때. - error: pathspec did not match any file(s) known to git 해결법

2022. 1. 8. 11:31

상황 : 기존 프로젝트를 리팩토링하며 리모트 저장소에 refactoring 브랜치를 하나 파서, 회사pc에서 작업 했다.

그 후, 집에 와서 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)하지 않는다.

 

참고 : https://stackoverflow.com/questions/5989592/git-cannot-checkout-branch-error-pathspec-did-not-match-any-files-kn

 

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' 카테고리의 다른 글

Windows 환경에서 Github pages와 jekyll 를 활용해 나만의 블로그 웹호스팅하기  (0) 2022.06.01
[git] 원격저장소 업데이트 명령어 3가지의 차이점 비교 -git remote update , git fetch , git pull 의 차이.  (2) 2022.01.08
Detached Head  (6) 2021.11.16
    'Git' 카테고리의 다른 글
    • Windows 환경에서 Github pages와 jekyll 를 활용해 나만의 블로그 웹호스팅하기
    • [git] 원격저장소 업데이트 명령어 3가지의 차이점 비교 -git remote update , git fetch , git pull 의 차이.
    • Detached Head
    까뮈_b
    까뮈_b
    까먹지 않기 위해서 개발 관련 시행착오를 정리한 포스트를 작성합니다.

    티스토리툴바