I’m a newbie.
I had some issues with my local repo and decided to delete the .git
folder. The issue now is that I tried reinitializing git, committing it and then pushing it but then I get this error
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/<name>/<folder>.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I’m stranded and out of options, how do I push the local repo back to its original repo on github using the main
branch and merging it seamlessly. Thanks
I have tried browsing and cross checking all details but I can’t still find my way around. Please I need help, I’m stuck.
Thanks.