Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Use `git rebase`. Specifically:
  2.  
  3. * Use `git stash` to store the changes you want to add.
  4. * Use `git rebase -i HEAD~10` (or however many commits back you want to see).
  5. * Mark the commit in question `(a0865...)` for edit by changing the word `pick` at the start of the line into `edit`. Don't delete the other lines as that would delete the commits.
  6. * Save the rebase file, and git will drop back to the shell and wait for you to fix that commit.
  7. * Pop the stash by using `git stash pop`
  8. * Add your file with `git add <file>`.
  9. * Amend the commit with `git commit --amend --no-edit`.
  10. * Do a `git rebase --continue` which will rewrite the rest of your commits against the new one.
  11. * Repeat from step 2 onwards if you have marked more than one commit for edit.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement