@dev park 박예빈

last update: 2020.12.21.


CONTENTS


1. Terminal & Command Line

1-1. Git : src refspec main does not match any

0. References

Message 'src refspec master does not match any' when pushing commits in Git

Message 'src refspec master does not match any' when pushing commits in Git

1. Introduction

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b97e679c-93eb-4a54-8209-ebb195269594/push-error.png

Github에 새로운 Repository를 생성하고 초기화 후 첫 commit 및 push를 날릴 때, Terminal에서 src refspec main does not match any라는 에러 메세지가 도출되는 문제의 디버깅에 대해 기술한다.

2. Problem

  1. git Repository를 생성하면 화면에 다음과 같은 command line을 입력하라는 내용이 보인다:

    git init
    git add README.md
    git commit -m "first commit"
    git branch -M main
    git remote add origin <https://github.com/foo/bar.git>
    git push -u origin main
    
  2. 위의 내용을 VS Code의 Terminal에 입력하고, git push -u origin main를 입력할 때 src refspec main does not match any라는 에러 메세지가 확인되며, push가 진행되지 않는다.