Today I Learned

hashrocket A Hashrocket project

View a File In Another Git Snapshot

Have you ever wondered: 'what does this file look like on the master branch?' vim-fugitive to the rescue.

This command will open our Gemfile as it exists on the master branch:

:Gedit master:Gemfile

And the same file, in the HR-TIL repo, initial commit:

:Gedit b4da33:Gemfile

This also works with tags, and includes split, vertical split, and tab variations— I like :Gsplit the best.

Install vim-fugitive and see :help Gedit for more information.

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.