When I do a git push origin branch
it tells me
error: failed to push some refs to 'https://github.com/some-project...'
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.
But when I do a git pull
it moves the HEAD back to the origin branch (i.e. it removes newly created files in my local), so i then have to do a hard reset.
I read some other forums stating to do a git pull rebase (which Im not sure how it'll work) and even a git push --force (which doesn't seem like something I should get use to). Are there other alternatives to this scenario and could you elaborate or add a link?