0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Git・GitHub 「"error: src refspec master does not match any" "error: failed to push some refs to 'github.com:〇〇/intro_git.git'"」のエラーへの対処法

Last updated at Posted at 2021-11-27

こちらのUdemyの講座を受講している際、タイトルのようなエラーに遭遇しました。
https://www.udemy.com/course/intro_git/learn/lecture/6449730#notes
(3分29秒)

ys@mbp intro_git % git push origin master

error: src refspec master does not match any
error: failed to push some refs to 'github.com:〇〇(GitHubのユーザー名)/intro_git.git'

結論
git push origin master ではなく
git push origin main を使う

ys@mbp intro_git % git push origin main

Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (17/17), 1.66 KiB | 567.00 KiB/s, done.
Total 17 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), done.
To github.com:〇〇(GitHubのユーザー名)/intro_git.git
   4817446..7f3dadd  main -> main

参考サイト
https://deepblue-ts.co.jp/git/git-push-error/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?