I’m wondering, how could I avoid a commit in really small changes of code. For instance, sometimes I miss a space between parameters or that kind of tiny code formatting. The reason I ask this is because later I have to push my commits to a remote repository and I don’t want to include those small changes.
Any ideas? Thanks
Update: As others pointed out, do not do any rebasing, or history re-writing of any sorts if you’ve pushed to a remote origin and shared this code with other developers. Short answer: It’s dangerous and risky!
I’d recommend checking out the rebase command for this. It does exactly what you are asking for
To use it:
Your editor will pop up with the last 5 commits from the head of the current branch, with some documentation. In your case you will want to use
squash. The site I linked explains it really well, they have this example:This will package the previous 3 commits and put them all under the one you’ve marked as
pick. You can then modify the commit message and so forth.Have fun