DEV Community

Dhanush
Dhanush

Posted on

4 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay