[git] error: pathspec 'main' did not match any file(s) known to git

2025. 1. 15. 22:48·⚙️ Tool/git

문제

❯ git checkout main
error: pathspec 'main' did not match any file(s) known to git

해결

❯ git remote update
Fetching origin
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (6/6), 1.10 KiB | 161.00 KiB/s, done.
From https://github.com/jinnkimm7/simple-board-with-mybatis
 * [new branch]      main       -> origin/main
❯ git checkout main
branch 'main' set up to track 'origin/main'.
Switched to a new branch 'main'
  • git remote update : 모든 원격 브랜치를 업데이트하여 최신 상태로 갱신합니다.

참고

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

'⚙️ Tool > git' 카테고리의 다른 글

[git] private repository clone시 remote: Repository not found  (0) 2025.03.19
[git] .gitignore 커밋 후 바로 적용 안될 경우  (0) 2025.01.20
'⚙️ Tool/git' 카테고리의 다른 글
  • [git] private repository clone시 remote: Repository not found
  • [git] .gitignore 커밋 후 바로 적용 안될 경우
jinnkimm7
jinnkimm7
[Nothing changes if nothing changes] 개발 관련 글 위주로 포스팅 할 예정이며, 그 밖에 자기개발/일상/여행에 관한 정보도 포스팅 할 예정입니다.
  • jinnkimm7
    Jin's log
    jinnkimm7
  • 전체
    오늘
    어제
  • ✍️글쓰기 🦺관리
    • 분류 전체보기 (86)
      • 📚 Record (0)
      • 👨‍💻 Programming (10)
        • JavaScript (3)
        • React (1)
        • Next.js (2)
        • HTML (0)
        • CSS (1)
        • Java (3)
        • Spring (0)
      • 💻 CS (13)
        • Computer Architecture (1)
        • Operation System (2)
        • Data Structure (0)
        • Algorithm (2)
        • Database (7)
        • Network (1)
      • ⚙️ Tool (12)
        • AWS (2)
        • git (3)
        • VS Code (2)
        • IntelliJ (0)
        • Eclipse (1)
        • Excel (4)
      • 📝 Coding Test (37)
        • Programmers Lv0 (6)
        • Programmers Lv1 (1)
        • Programmers Lv2 (2)
        • Programmers Lv3 (1)
        • 백준 Bronze (0)
        • 백준 Sliver (3)
        • SQL (24)
      • 📖 Study (9)
      • 🔠 English (0)
      • 🎒 Travel (0)
      • 💰 Finance (0)
      • 📌 Etc (3)
  • 링크

    • Resume
  • 인기 글

  • 최근 댓글

  • 최근 글

  • 태그

    코딩테스트준비
    항해99
    백준
    오라클
    java
    next.js
    프로그래머스
    코딩테스트
    99클럽
    dynamodb
    반도체8대공정
    MYSQL
    vscode
    오블완
    클래스
    git
    AWS
    코딩테스트연습
    SQL
    티스토리챌린지
  • hELLO· Designed By정상우.v4.10.0
jinnkimm7
[git] error: pathspec 'main' did not match any file(s) known to git
상단으로

티스토리툴바