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

Additions to git tips & tricks - using fixup commits to ammend an existing pull request #573

Open
TraceyC77 opened this issue Oct 20, 2024 · 0 comments

Comments

@TraceyC77
Copy link
Contributor

Assuming you're in a package foo's directory and you just made a change that you want to amend/fixup to the previous commit (e.g. forgot to bump release number, last rebuild before submission that changed the pspec build date), you can run the following to create a fixup commit that's associated with the last commit performed to this package:

# fixup commit      last commit in directory
git commit --fixup $(git log -1 --format="%h" -- .)

For example, if the last commit for in this package's directory is foo: update to 1.4, then your fixup commit would be something like

fixup! foo: update to 1.4

and when you run git rebase --autosquash (or choose fixup manually in git rebase -i), your fixup commit would be amended to its previous commit. You can keep stacking up fixup commits and they will all get amended in the creation order to the initial target commit.

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

No branches or pull requests

1 participant