Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

Rejected Non Fast Forward-Git Push Rejected “Non-Fast-Forward”

Asked by Ankesh Kumar Nov 16, 2022 11.4K views 1 answer
Share

About this question

 I am fairly new to git yet currently using it to manage our code in a team environment. I had some rebasing issues and I fixed them using


git checkout --ours filename.txt

git add filename.txt

git rebase --continue

Now I wish to push my changes, and so running the following command


$ git push origin feature/my_feature_branch

gives me the following error:


To ssh://git@coderepo.com:7999/repo/myproject.git

 ! [rejected]        feature/my_feature_branch -> feature/my_feature_branch (non-fast-forward)

error: failed to push some refs to 'ssh://git@coderepo.com:7999/repo/myproject.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')

hint: before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

What can I do to get rid of the error? What does git push rejected non-fast-forward mean?

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.