We want to associate a local project with a remote repository and push it, but why does it report this error?
It turns out that when we create a repository, we will check the option to initialize the repository with a Reamdme file, initialize a README file, and configure and add ignore files.
When we click Create Repository, it will help us make an initial commit.
So, our repository has README.m and .gitignore files.
Next, we associate the local project with this repository and push the project to the repository.
When we associate the local and remote, there are contents on both ends, but the two contents are not connected.
When we push to the remote or pull content from the remote, there will be untracked content.
So, you can see in the detailed errors reported by git that it always asks you to pull first and then push.
wangziguo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.