- git init
- git remote add origin https://github.com/RajK01/3D-Rotating_Image-Gallary.git
- git status
- git branch -M main
- git add img/
- git push -u origin main
- Error: ! [rejected] main -> main (fetch first) error: failed to push some refs to 'https://github.com/RajK01/3D-Rotating_Image-Gallary.git' hint: Updates were rejected because the remote contains work that you do 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.
- git fetch origin main:tmp
- git rebase tmp
- git push origin HEAD:main
- Error: ! [rejected] HEAD -> main (non-fast-forward) error: failed to push some refs to 'https://github.com/RajK01/3D-Rotating_Image-Gallary.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
- git push -f -u origin main 🎇✨ Successful🎇✨