git reset for squashing - antipattern? -


Commits to GIT for squashing, general advice given to me is to use rebase command. Apart from this, to use interactive (-i) for more detailed options.

But, the pattern I've come across (only playing around) is to use reset command for squashing.

Usually I do:

  git reset original / < Working on branch & gt;   

Or, if I have to squash in any way:

  git reset & lt; Sha & gt;   

Then, after adding and committed, my local command crushes in one and I am ready to push.

Am I following an anti-pattern? What kind of negative side effects can I run?

The main approach that you lose from this point of view is fine control.

With an interactive rebase you do not have to squash just 1 commute, you can group them into a logical change set and if you need,

Apart from this you get a chance to select a committed message instead of just writing a new one, it is important if your memory is as bad as mine; -)

However, in all the interactive rebates you have only one tool that you can manipulate your local commute history, if you can do what you have to do in another way Easy to say, so I say, why not.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -