git Power Push

Rebasing is a frequent process for anybody utilizing git. We generally use rebasing to department our code from the final modifications and even simply to drop commits from a department.

Oftentimes when making an attempt to push after a rebase, you will see one thing like the next:

trace: Updates had been rejected as a result of the tip of your present department is behind
trace: its distant counterpart. Combine the distant modifications (e.g.
trace: 'git pull ...') earlier than pushing once more.
trace: See the 'Observe about fast-forwards' in 'git push --help' for particulars.

Generally builders will use the --force or -f flags throughout a push to drive pushing code modifications:

git push origin my-branch --force
# or
git push origin my-branch -f

I used to be not too long ago shocked to search out out that you would additionally prefix the department identify with + to drive a push:

git push origin +my-branch

The + syntax is attention-grabbing however does not appear intuitive so it isn’t a observe I would use, however that does not imply you should not!

  • 9 Mind-Blowing Canvas Demos

    The <canvas> component has been a revelation for the visible specialists amongst our ranks.  Canvas offers the means for unimaginable and environment friendly animations with the added bonus of no Flash; these builders can flash their superior JavaScript expertise as an alternative.  Listed below are 9 unbelievable canvas demos that…

  • Being a Dev Dad

    I get requested a great deal of questions day by day however I am at all times shocked that they are not often questions on code and even tech — most of the questions I get are extra about non-dev stuff like what my workplace is like, what software program I take advantage of, and oftentimes…


Leave a Reply

Your email address will not be published.