Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
820 views
in Technique[技术] by (71.8m points)

github - Issue connecting new repo with local folder

I am doing a poor job on learning how to properly set-up a local folder with github.

Here are the steps I have done.

1: cd to the folder I want to connect to. 2: git init 3: git remote add origin master (repo link .git) 4: git push origin master

at step 4 I get the following issue: Georges-MacBook-Pro-2:meetlete georgeconnolly$ git push origin master error: src refspec master does not match any error: failed to push some refs to 'https://github.com/grobconnolly/meetlete.git'

Does anyone know where I am going wrong?

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I did see your repository, it contains README.md. While your local repository does not contain anything.

Which creates conflict with your global repo (A common mistake).

You can perform below steps.

$ git init
$ git remote add origin https://github.com/grobconnolly/meetlete.git
$ git checkout -b main
$ git pull origin main --no-rebase
$ git push origin main

Here pull --no-rebase will append remote objects to local. And checkout -b will create a new branch named main (Else git default will generate branch master).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...