Error pushing to GitHub using Git for Windows

前端 未结 2 1754
不思量自难忘°
不思量自难忘° 2021-01-28 15:22

I have created a Git repository on GitHub, and a local repository too. First I pulled the remote repository into the local one. Then I added a file, staged the file, committed i

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 15:47

    The remote repo is not empty; it contains a README that you probably created through the GitHub web interface. You have to pull it before you can push to it:

    git pull --rebase origin master
    git push
    

    (The --rebase is not strictly necessary but avoids an ugly merge commit.)

提交回复
热议问题