Hardware Acceleration - harness your device's power with OpenGL rendering.Flexible Layouts - adapt the layout to fit your context and workflow.Upgraded Commit UI - focus on what’s important with an upgraded commit UI.Repository-Level Tabs - use tabs to quickly navigate between multiple repositories.We’ve included the full list of changes at the bottom of this post (spoiler: there’s a lot) The latest version of Sublime Merge is packed full of upgrades, but we want to highlight some of the ways we’re giving you flexibility in the way you work. Our community uses Sublime Merge in many different ways from reviewing commits on a tablet, to writing thousands of lines of code on a desktop computer. Our aim for the newest update was to ‘get it really right’ when it comes to flexibility and customization. It’s been almost two years since Sublime Merge was launched, and our focus hasn’t changed. git checkout -theirs myscript.From the first release of Sublime Merge, we talked about the simple joy of software that ‘gets it really right’.įor our team it means going beyond the minimum, making software as good as it can be, and paying attention to the details. Use -theirs to keep changes from the feature branch. git checkout -ours myscript.py Use -theirs to keep the changes from the "current" branch ( feature)Īnd naturally, the opposite is true. Use -ours to keep changes from the branch being rebased onto ( master)Īt the beginning of the rebase, we had feature branch checked out, so it may seem backward, but we will use -ours to keep changes from master. So -ours and -theirs will appear to be flipped around. And the commits being merge into the current branch are the commits from your original feature branch. The point of that long winded explanation was to show that when you are fixing merge conflicts in the middle of a rebase, your "current" branch is not longer your original feature branch but rather a new branch that is up to date with master. The new history looks like this: A-B-C featureĭ-E-F-G master Ok, so how do I use git checkout -ours/-theirs during a rebase? It's important to note, for the sake of this guide, that this is accomplished through a merge. Now each change from the feature branch ( A, B, and C) will be applied to the new feature branch once again. A-B-C (saved in temporary files)ĭ-E-F-G master Apply the saved changes from the feature branch The feature branch now has the same history as master. A-B-C (saved in temporary files)ĭ-E-F-G master Reset the feature branch to the current commit from master In our case, we roll back to commit E, and save the diff of each commit introduce by the feature branch. When we rebase master "into" feature, what we are really doing is this: "Roll back" to the common ancestor and save the diff What happens during a rebase?Īgain, let's assume the following history: A-B-C feature Let me explain what happens during a rebase. But, the tricky part is identifying the "current" branch. When we run into merge conflicts during a rebase, we are effectively in the middle of a merge, so the rules for git checkout -ours/-theirs from above still apply. If we want to discard the version of myscript.py that resides in our current branch and keep the version from master, we can use -theirs. git checkout -ours myscript.py Use -theirs to keep the version from the branch being merged inĪnd -theirs accomplishes the opposite. Since we have our feature branch checked out, we can use -ours to keep the version of myscript.py that resides in the feature branch, and disregard the version from master. Use -ours keep the version in the current branch This is where git checkout -ours/-theirs comes into play. But in some cases, you'll want to completely disregard one version and keep the other. In most cases, you'd want to open myscript.py and sort out the merge conflicts. But when we go to merge master into feature, we're going to run into trouble: (feature) $ git merge masterĬONFLICT (content): Merge conflict in myscript.pyĪutomatic merge failed fix conflicts and then commit the result. A common strategy is to routinely merge changes from master into your feature branch during development to keep the feature branch from getting too far out of date. So changes were made to myscript.py in both master and feature branches. The letters signify a commit, and each commit includes changes to our file: myscript.py. Imagine our git history looks like this: A-B-C feature You might be wondering about rebases, and I'll explain that in the next step.įor simplicity, let's start with a basic merge conflict. Technically speaking, use of git checkout -ours/-theirs is only applicable during a merge.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |