DEV Community

Dhanush
Dhanush

Posted on

Answer: Github "Updates were rejected because the remote contains work that you do not have locally."

This happens if you initialized a new github repo with README and/or LICENSE file

git remote add origin [//your github url]
//pull those changes

git pull origin main 

// or optionally, 'git pull origin main --allow-unrelated-histories' if you have initialized repo in github and also committed locally

//now, push your

Top comments (0)