Everyday Git Commands in RubyMine

June 16, 2013 Jared Carroll

As a long-time command-line Git user, I was hesitant to adopt RubyMine’s version control tools. But I decided to give them a try, and I’m glad I did. RubyMine’s version control tools make common Git commands more accessible and easier to execute. The addition of a GUI is great for tasks such as diffing a file, or viewing commit logs. In this post, we’ll look at performing everyday Git commands in RubyMine on OS X.

git-diff

You can view a diff of all your changes from the Changes tool window.

changes-tool-window

Press command + 9 to open the Changes tool window. Then press command + D to view a diff of all your changes.

view-diff

You can diff a single file by selecting “Compare with the Same Repository Version” from the VCS Operations popup. Press control + V to open the VCS Operations popup.

compare-vcs-operations-popup

git-commit

Press command + K to commit changes.

commit-changes

git-push

Select “Push…” from the VCS Operations popup, control + V, to push your local changes.

push-vcs-operations-popup

git-pull

Press command + T to pull in the latest changes.

update-project

git-log

To view the Git log, open the Changes tool window, command + 9, then navigate to the Log tab with command + shift + ].

git-log-changes-tool-window

To see the log of a single file, select “Show History” from the VCS Operations popup, control + V.

show-history-vcs-operations-popup

This will open the log in the Version Control tool window.

show-history

git-checkout

Revert changes by selecting “Revert” from the VCS Operations popup, control + V.

revert-vcs-operations-popup

git-blame

Determine who changed a file by selecting “Annotate” from the VCS Operations popup, control + V.

annotate-vcs-operations-popup

The committers will be displayed to the left of the editor gutter.

annotate

Don’t Abandon the Command-line

In this post, I focused on the most commonly used Git commands. RubyMine also includes support for more powerful Git commands, such as git-reset and git-rebase. However, I find their RubyMine GUI-based implementations slow and clumsy. As much as I want to stay in RubyMine, I find the best version control strategy is to use RubyMine for common Git commands, but turn to the command-line for the hard stuff.

About the Author

Biography

Previous
The passing of time, and all of its crimes.
The passing of time, and all of its crimes.

Programmers are constantly implementing time-related features, and accidentally including time-related bugs...

Next
Balancing Convenience and Security in mCommerce
Balancing Convenience and Security in mCommerce

Finding the right balance between convenience and security is an issue we frequently encounter with our mCo...