git-squash icon indicating copy to clipboard operation
git-squash copied to clipboard

Untracked files also included in the commits

Open securelyshare-shiva-kumar opened this issue 2 years ago • 3 comments

Hi I loved this small git utility and helped me a lot to keep my git history clean and do it quickly. Only one problem I am facing is, if I have any untracked files they also getting committed to squashed commit. Is there anyway to ignore untracked files automatically. Right now, I have to move them to a different folder or add them to .gitignore file or move it to folder outside git repo.

You could git stash them?

rorynolan avatar Oct 17 '23 17:10 rorynolan

Perhaps git-squash should fail when there are untracked files?

It already checks for changed files:

https://github.com/sheerun/git-squash/blob/e87fb1d410edceec3670101e2cf89297ecab5813/git-squash#L18-L21

EDIT: On a related note, it is using git add -A? Is there a way to implement this script without needing to git add?

https://github.com/sheerun/git-squash/blob/e87fb1d410edceec3670101e2cf89297ecab5813/git-squash#L45

srid avatar Nov 28 '24 22:11 srid

If you feel this helps, I'd like to accept such PR

sheerun avatar Dec 02 '24 13:12 sheerun