This will open a file in your text editor representing your new commit message. To amend the previous commit, make the changes you want and stage those changes, and then run git commit -amend How do I recover/resynchronise after someone pushes a rebase or a reset to a published branch? Or maybe you do, but in that case you will have to take great care to communicate with everyone who may have pulled your commits and done work on top of them. Note that you will not want to change commits that you have already pushed. It’s very easy you don’t need to memorise it – just remember that git rebase -interactive lets you correct commits no matter how long ago they were. Most of this sequence will be explained to you by the output of the various commands as you go. For each commit you want to edit, Git drops you into the shell. Once you save, Git will replay the listed commits.įor each commit you want to reword, Git will drop you back into your editor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |