![]() git rebase starts rebasing and stops on the marked commits. Save the list of rebase actions and discard the temporary buffer with the selected commit hashes. Search and replace 'pick' with 'edit' on the lines matching the selected commit hashes. Return to the buffer with rebase actions. ![]() In vim we copy this to a register and paste it later into the minibuffer via CTRL+ r. The \n concatenates the lines to a single line. (note: that \x selects hex-digits and OP's hashes contain non-hex digits suck as j and k, so OP might need \w and, in my siuation git log -oneline produced 9 digit hash abbreviations, you might need a different length (the made-up example needs ).*\n/\1|/ :r !git log -oneline -G"MyFunction" my-branch-prerebaseĬhange the (generated) list of revisions into a format that your editor can use as an expression to select lines to edit. (note you need to specify my-branch-prerebase to git log, since HEAD now points to my-branch-base and git log would not select any applicable commit hashes.): :vsplit Open a second buffer -in the editor started by git rebase- with the output of the revision selection command or a the file with the hashes to edit. Then start the rebase: git rebase -interactive my-branch-base (because: you will have a backup in case your rebase does not work out as you intended and, if you select commits to edit via git log, git needs a reference to them during the rebase): git branch -c my-branch my-branch-prerebase Make a copy of your branch HEAD pre rebase I'll show how to select them via a command. Perhaps they come from a file perhaps they come from a command (such as git log -G"MyFunction"). In this range there are some commits to edit: Get all the commits which have some piece of code (added/updated/deleted) for a given author. Say we have a range of commits in branch my-branch on top of a revision (i.e. Git log to show commits either by author OR commit message. All my repositories are private (company regulations) so I wasn't sure how to create a reproducible example.NOTE: This answer depends on capabilities of the text-editor opened by git rebase. ![]() It’s a simple way to show the differences between 2 branches. This command is particularly useful when you use branch references as the parameters. The range is specified in the following format, where and are commit references: git log. Sorry I didn't add a reproducible example. You can pass a range of commits to git log to show only the commits contained in that range. I know that I don't have hundreds of merge commits, so what am I missing here? Instead of having a file with hundreds of lines, I get 24. In both cases, I loose hundreds of commit messages. Git log -pretty=oneline -no-merges -decorate=short 0.0.0.0.0.1> file3.txt Git log -pretty=oneline -no-merges -decorate=short mit2> file2.txt ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |