Software Development

git Power Push

Written by admin

Rebasing is a frequent activity 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 may 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 'Be aware about fast-forwards' in 'git push --help' for particulars.

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

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

I used to be not too long ago stunned to seek out out that you can additionally prefix the department identify with + to power a push:

git push origin +my-branch

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

  • Write Simple, Elegant and Maintainable Media Queries with Sass
  • 7 Essential JavaScript Functions

    I keep in mind the early days of JavaScript the place you wanted a easy operate for almost all the pieces as a result of the browser distributors applied options in a different way, and never simply edge options, fundamental options, like addEventListener and attachEvent.  Instances have modified however there are nonetheless a couple of features every developer ought to…


About the author

admin

Leave a Comment