Skip to content

git fixup and autosquash #65

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

Merged
1 commit merged into from
Jun 26, 2014
Merged

git fixup and autosquash #65

1 commit merged into from
Jun 26, 2014

Conversation

cgcgbcbc
Copy link
Contributor

tells how to use git commit --fixup= and git rebase -i --autosquash to fixup commits

@tomaszzielinski
Copy link

This looks like git commit --amend, only more difficult to remember.

@oderwat
Copy link

oderwat commented May 25, 2014

But --amend only works for the last commit. This is for any older commit in your history. Like fixing a typo 4 commits ago.

@tomaszzielinski
Copy link

Good point, I read "previous commit" as "parent commit".

@oderwat
Copy link

oderwat commented May 25, 2014

It could probably written more clear. I also usually prefer to do this task with a manual "edit" in the interactive rebase. Usually because I want to test if stuff works at that point after the change. And it is much more transparent than using "magic fixups" :)

@cgcgbcbc
Copy link
Contributor Author

Good point, I read "previous commit" as "parent commit".

@tomaszzielinski I added some explanation to "previous"

@cgcgbcbc
Copy link
Contributor Author

It could probably written more clear. I also usually prefer to do this task with a manual "edit" in the interactive rebase. Usually because I want to test if stuff works at that point after the change. And it is much more transparent than using "magic fixups" :)

@oderwat Yes, I always use simply git rebase -i and manually squash , edit or pick commit. I didn't know this magic fix-up until yesterday. It is nice to test at that fixup point, but if one test the fix-up before rebase and has confidence in himself 😉 , he can use this approach to quickly solve the problem.

@tiimgreen tiimgreen assigned ghost May 26, 2014
@ghost ghost added the feature label Jun 2, 2014
@@ -637,6 +638,15 @@ Will give you a list of branches that have not been merged into your current bra

[*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch)

### Fixup and Autosquash
If there is something wrong with a previous (can be one or more from HEAD) commit, for example `abcde`. After make changes, run the following command.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to "If there is something wrong with a previous commit (can be one or more from HEAD), for example abcde, run the following command after you've amended the problem:" and I will merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafalchmiel updated.

ghost pushed a commit that referenced this pull request Jun 26, 2014
@ghost ghost merged commit 0bd08f7 into tiimgreen:master Jun 26, 2014
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants