Reputation: 1
I am assuming that I am getting this message because one commit is created (Added README.md, .gitignore files) automatically when I created the new repository on Azure Devops remote repository.
How can I push it to the remote repository?
I did fetch command but still getting the same message and cannot push. Note: I am the only one working for the new repository and nobody touches or push it.
Upvotes: 0
Views: 966
Reputation: 76414
Your assumption is correct. The existence of the commit on the other repo which does not exist at your end is the problem. You can do one of the following:
git push -f origin master
will force-push your changes.
git pull
from the remote will solve your problem, you will need to solve the merge conflicts then.
You can also solve it with git rebase
. Finally, you can simply remove the latest commit on your remote.
Upvotes: 0