Forem

DanKim0213
DanKim0213

Posted on β€’ Edited on

1

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

Troubleshooting

I prefer rebasing my feature branch onto Master branch before PR (Pull Request). But, sometimes I got this:

$ git push origin feature/specific-feature
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.
Enter fullscreen mode Exit fullscreen mode

This happens when I already pushed Feature branch to Github and thus the sync between my local feature branch and the remote branch in GitHub got broken. To resolve this issue:

$ git push -d origin specific-feature
$ git push origin specific-feature
Enter fullscreen mode Exit fullscreen mode

Some developers recommend using force-push. Though, in my preference, deleting the remote branch is more appropriate since force-push has several caveats and I or my colleagues in some situations would abuse force-push if we are used to force-push.

This flag disables these checks, and can cause the remote repository to lose commits; use it with care.

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (3)

Collapse
 
yezgoget profile image
YE G β€’

ChatGPT wrote this

Collapse
 
dankim0213 profile image
DanKim0213 β€’

γ…‹γ…‹γ…‹γ…‹γ…‹γ…‹γ…‹γ…‹γ…‹

Collapse
 
whimsybin profile image
Whimsy-bin β€’ β€’ Edited

This corrected my commit error exactly. I really appreciate for this f**kin adorable post! thx Dankim, I luv u :)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay