Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untracked files also included in the commits #6

Open
securelyshare-shiva-kumar opened this issue Jun 26, 2023 · 3 comments
Open

Untracked files also included in the commits #6

securelyshare-shiva-kumar opened this issue Jun 26, 2023 · 3 comments

Comments

@securelyshare-shiva-kumar

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.

@rorynolan
Copy link

You could git stash them?

@srid
Copy link

srid commented Nov 28, 2024

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

It already checks for changed files:

git-squash/git-squash

Lines 18 to 21 in e87fb1d

if [ "$(git status -s -uno)" != "" ]; then
echo "Please commit all changes before squashing"
exit 1
fi

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

git add -A

srid added a commit to srid/nixos-config that referenced this issue Nov 28, 2024
It commits untracked files! And uses `git add -A`.

sheerun/git-squash#6
@sheerun
Copy link
Owner

sheerun commented Dec 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants