-1

on entering "git push origin master" it is giving the error below:

! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://A....' 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.

1 Answers1

0

For some reasons your master branch is out of sync with the distant one origin/master.

Backup your work by pulling another branch from your master:

git branch  master-backup

Set your branch to the distant one to sync them:

git reset --hard origin/master

Find and cherry-pick the commits that you've made:

git log master-backup. (Prints your history)
git cherry-pick sha1C  sha1C2 ....

Push your branch without any problem.

AElMehdi
  • 572
  • 4
  • 12