1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-14 12:38:01 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Dylan Irlbeck
1e3d57f12a Merge 5365e75267 into 1316eb70ec 2025-03-10 08:45:41 -03:00
Dylan Irlbeck
5365e75267 Update git show TIL 2020-04-29 22:17:44 -05:00

View File

@@ -2,16 +2,16 @@
Sometimes you want to view a file on another branch (without switching Sometimes you want to view a file on another branch (without switching
branches). That is, you want to view the version of that file as it exists branches). That is, you want to view the version of that file as it exists
on that branch. `git show` can help. If your branch is named `my_feature` and on that branch. `git show` can help. If the other branch is named `some_branch` and
the file you want to see is `app/models/users.rb`, then your command should the file you want to see is `app/models/users.rb`, then your command should
look like this: look like this:
``` ```
$ git show my_feature:app/models/users.rb $ git show some_branch:app/models/users.rb
``` ```
You can even tab-complete the filename as you type it out. You can even tab-complete the filename as you type it out.
See `man git-show` for more details. See `man git-show` for more details.
[source](http://stackoverflow.com/questions/7856416/view-a-file-in-a-different-git-branch-without-changing-branches) [source](https://stackoverflow.com/questions/7856416/view-a-file-in-a-different-git-branch-without-changing-branches)