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

How to solve the error of git push rejected non fast forward?

Asked by Brian Kennedy Jul 25, 2023 6.4K views 1 answer
Share

About this question

I am totally a novice to git. However I am recently deploying it to handle the code in the team environment. I have faced few rebasing problems but I solved the error utilizing

Git checkout - - ours filename.txt
Git add filename.txt
Git rebase - - continue
Now I want to push the alterations, and thus I am executing the below-given command.
$ git push origin feature/my_ feature_branch
However, I am receiving the belo-mentioned 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.

How do I fix this error? Also, what is the meaning of git push rejected non-fast-forward?

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.