If you view the options for a branch which is not currently checked out, you'll have many more options:Īs before you can navigate these with the arrow keys and select using Enter. The highlighted "Update" option here effectively does a git fetch master:master, and fast-forwards or does a merge, depending on your settings. If you select the currently-checked out branch, as shown below, you'll get the options shown below: You can view individual actions for a specific branch by navigating up and down with the arrow keys and pressing ➡ or Enter on a branch. Do a git fetch by clicking the blue arrow ↙ at the top of the dialog.Star ⭐ a highlighted branch by pressing space, which keeps the branch at the top of the list.Create a new branch (more on that later).View the current checked-out branch (shown at the top of the local branches list, marked with a tag symbol □).This opens a dialog box:Īs you can see from the above screenshot, this dialog lists all your local (and remote) branches. You can view all the branches for a repository using the shortcut ctrl+ shift+ `. Most of the shortcuts I describe are the defaults, but in some cases I've tweaked or added shortcuts. In this section I'll describe how I typically work with Git branches using Rider. git switch main) this seems to cause Rider to do more work to figure out what's changed than if you switch branches using the IDE.įor the record, Visual Studio similarly has a fit if you change branches for a solution you have open! Working with Git branches in Rider While you can switch branches using the command line (e.g. For the most part, I use keyboard shortcuts to navigate the various Git features, falling back to the mouse for features for which it makes sense.Īnother important reason to use the built-in Git feature is that Rider seems to prefer it if you do. I like Rider's Git integration, because it lies somewhere in-between. On the other hand, GUIs are typically "slower", requiring UI interaction rather than just typing commands, and may not provide access to the full gamut of Git commands and options. Some features are also just easier to do with a GUI, such as selecting a subset of changed lines in a file to stage. You're guided towards the common options, and it's harder to make "mistakes". GUIs are, for the most part, far more discoverable than command-line Git. After reading this 10 years ago, something clicked, and I finally "got it". If you've dabbled with Git, but don't feel like you understand a rebase (for example), I strongly suggest reading Think like a Git. The main drawback of the command line is that it's really hard to know where to start unless you already know Git. Proponents of command-line Git advocate for the ability to script command-line interaction and the enhanced power that comes at the command line thanks to all the extra available commands and switches. As always, there are extreme views on both sides, and the reality likely lies somewhere in the middle. One of the endless (mostly-pointless) debates in software is whether "real" programmers should always use the command line, or whether it's "fine" to use a GUI. Whether it's switching branches, committing, or rebasing, I typically use Rider's built-in Git support. One such built-in feature I use daily is the git integration. For example the database integration (Datagrip) is brilliant, making it easy to query and managed a wide variety of database types. One of the selling points of Rider, is that it can leverage all the existing tech from JetBrains' other products. If you're like me, just persist with it, I think it's worth the effort! It's kind of silly, but one of the things I always struggled with was the Java-based UI, that just didn't look as polished as Visual Studio, and the difference in code-highlighting/theming. Fast-forward, and now it's my daily driver. When JetBrains' Rider first came out, it seemed like the perfect solution-all the power without the lag-but in practice I initially found it lacking in features. I was (like every other R# user) in love with all the additional refactorings R# provided, but despised how slow it made Visual Studio. Switching to JetBrains Riderįor years I was an avid Resharper (R#) user. If that wasn't the case, I would absolutely purchase a personal license (as I did for Resharper), and they have lots of discounts available if you're a student for example. Rider is a paid-product, but as a Microsoft MVP, JetBrains provide a licence free-of charge. But that doesn't mean I use the mouse-there's shortcuts for everything, so you can keep the efficient keyboard-based workflow command-line enthusiasts crave! I'm a bit fan of command-line Git for many things, but the Git integration in Rider is so good, that I do almost everything from the GUI now. In this post I describe one of the features I really like about the JetBrains' Rider IDE: its built-in Git support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |