Sublime merge interactive rebase4/14/2023 The default value of 'pick' which you see in the example above just means to use that commit - hence why if you don't edit this file, it'll do a normal replay of original commits. To modify what the rebase will do, all you do is edit the word at the start of each line. If you close this without making any changes, then it'll do the same as a non-interactive rebase and just replay them as is. These are the commits that are about to be replayed (displayed in ascending order). It's the lines at the top which are important. The lines starting with a hash symbol (or 'pound' symbol depending on where you live!) are just comments to help you out. # Note that empty commits are commented out # However, if you remove everything, the rebase will be aborted. # If you remove a line here THAT COMMIT WILL BE LOST. # These lines can be re-ordered they are executed from top to bottom. # x, exec = run command (the rest of the line) using shell # f, fixup = like "squash", but discard this commit's log message # s, squash = use commit, but meld into previous commit # e, edit = use commit, but stop for amending # r, reword = use commit, but edit the commit message When you start an interactive rebase, your default text editor will pop up with a list of the commits it's going to replay. In most scenarios where I'm doing an interactive rebase, I tend to always do this. starting the replaying of commits from the 'origin/master' commit. However that could have been any of Git's many ways of referencing a commit - a branch reference, a commit id (SHA), etc.īy choosing 'origin/master', it will replay all the local unpushed commits in the master branch - ie. So from the command line, you could do this: git rebase -i origin/master The golden rule still applies in that you should only modify the history of commits that haven't been pushed, as this can cause bad headaches for other developers! How do you do it?Īn interactive rebase is started with the -i flag. Split out the commit into multiple commits.Here are some examples of what you can do. Interactive rebasing gives you much more power by giving you a list of commits that are about to be replayed, and asking you want you want to do with those commits. However, there are other changes you may need to do to tidy up your local commits before pushing. I only covered a very basic rebase to tidy up the local commits before pushing them and get rid of the merge commit. So what is an interactive rebase?Īs mentioned in my last post, a rebase is where Git replays commits to change the Git history in some way or another. However, it does fit nicely into a follow up post about more advanced Git rebasing!. As that would have then moved into the topic of interactive rebasing, I felt that this was beyond the scope of the particular problem I was trying to discuss. After getting feedback from a colleague, it was suggested about also mentioning squashing commits as another way of tidying up the commit history. That post only talked about a very simple rebase to avoid that particular problem. It makes the history extremely hard to read and understand. the branches are diverging and remerging back in all the time. The problem is that it creates pointless merge commits, and also stops the Git history from being linear, ie. We'll also be getting a new Sublime Text Dev Build out this week, rolling in all the updates from Sublime Merge, including the updated theming system and Mojave support.My last post was focused around a problem in Git which occurs when the rebase command isn't used, and developers blindly use pull/push. This isn't at the top of the list, but they're coming. Sublime Text style plugins are on our radar. We'll be adding extra commit wrangling functionality, including reordering commits, moving commits between branches, and amending arbitrary commits. Sublime Merge currently supports editing commit messages and squashing commits (available from the commit context menu). We've had a lot of requests for UI support here, so it'll be making it in too. Git Flow is a branching strategy with an accompanying set of command line tools. The Switch Repository functionality (under the File menu) helps with this, but tabs have their own benefits, so they're on their way. Tabs have been frequently requested by users working on several repositories at once. Sublime Merge understands submodules, but doesn't provide any UI for managing them. We've got some nice things cooking for this that will be coming in the near future. Sublime Merge itself handles large repositories well, but there's more the UI could do to help users with a lot of branches on the go. This isn't a comprehensive list, but it should give an indication of what we're focusing on right now. Just a quick post about what we're going to be adding to Sublime Merge.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |