I used to use `gt ca -an` to modify my previous co...
# how-do-i
j
I used to use
gt ca -an
to modify my previous commit whenever I wanted to make small changes without a new commit. To my understanding that should now be
gt modify
. Now though, after staging files,
gt modify
tells me I’d be committing an empty commit, even though the changes are staged.
Copy code
~/rasayel/rasayel-core jonny/eng-2941 *32 +1 ❯ gt modify
✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
On branch jonny/eng-2941
Your branch is up to date with 'origin/jonny/eng-2941'.

No changes
You asked to amend the most recent commit, but doing so would make
it empty. You can repeat your command with --allow-empty, or you can
remove the commit entirely with "git reset HEAD^".
ERROR: Command failed with error exit code 1:
git commit --amend --no-edit
Am I doing something wrong?
gt
version 1.0.6
Interestingly, I changed branch and this worked on the other branch 🤔
j
Your first sentence is correct. Based on git's error here, it looks like you've hit a case where your amend would would result in the commit having no changes and we aren't calling
commit --amend
in such a way that would allow that to happen
j
Interesting, what’s weird here is I absolutely had changes, I made a fresh commit and it then worked, with the new changes. Not sure what happened. But it’s been working since so probably all good