I made a commit A and now have additional changes that, if I committed, would give me two commits A and B.
What is the most efficient way to combine new changes with those from the previous commit, so that I only get one commit?
git add -u && git commit --amend
This will do all the local changes and then use them to overwrite the previous commit. Note that if you already pushed the previous commit, this is a really bad idea.
If you have not made the second set of changes, do what Kevin said. If you have one, use git rebase -i to crush them together.
git rebase -i
Source: https://habr.com/ru/post/1339102/More articles:Simplify redundant jQuery code - jqueryFind the largest value 5 less than 1, the lowest 5 values - rRegEx vs string management functions: which is better - c #JQuery code to simplify - jqueryWeb service request request. SOAP request missing empty parameters. - c #Leksah system module browser empty - browserlayout_height always wraps content - androidLooking for something to add some standard rules for my C ++ project - c ++GWT RequestFactory: how to handle objects with compound primary keys - gwtDoes anyone know a good implementation of file size as a value object in PHP? - oopAll Articles