! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/mehrdad7027R/minakan.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.
The error message is telling you that the branch you are trying to push is behind its remote counterpart. This means that the remote branch has commits that you don't have in your local branch.
To fix this, you need to pull the remote changes into your local branch. You can do this by running the following command:
git pull origin main
Once you have pulled the remote changes, you can push your local branch to the remote repository by running the following command:
git push origin main
This should resolve the issue and allow you to push your local branch to the remote repository.
$ git pull origin main
From https://github.com/mehrdad7027R/minakan
* branch main -> FETCH_HEAD
Already up to date.
$ git push origin main
To https://github.com/mehrdad7027R/minakan.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/mehrdad7027R/minakan.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.