I got one Master branch on local and on my github repo.
As I commit locally I push it to remote (origin)
I checked out a specific commit from my github using the following command;
git checkout master
git fetch origin
git reset --hard thespecificcommitiwanted
I then worked on this commit that got fetched and intended to make a new commit and push back to origin using the following command;
git add .
git commit -m "bla"
git push origin
and I got the following error;
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/mysamza/Jawahir.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.