-2
To https://github.com/firstrepo/first-project.git ! [rejected] main -> main (fetch first) error: failed to push some refs to 'https://github.com/firstrepo/first-project.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 
3

2 Answers 2

1

Pull the changes first with git pull and after git push. Seems that the online repo has more folders/files than your code in local on your computer. Are other people working on the same project together with you?

Sign up to request clarification or add additional context in comments.

Comments

0

This error occurs when you make any changes to your github repo manually by going to github site, which causes a conflict b/w your local repo and the github repo. As shown in the error, use git pull to match them again and then use the same commands again

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.