← #89 Truncate long text

View a file in a different branch without switching the branch

Topics: Git

We can use the following command to see the content of a particular file on another branch:

$ git show branch:file
  • branch represents the name of destination branch
  • file represents the relative path of the file

For example, git show feature/tip:css/styles.css shows the content of the file located at css/styles.css in the feature/tip branch.

You also can open the file in your favourite editor, Vim for example:

$ git show branch:file | vim -
Fix a typo or suggest an improvement
#91 Move the screenshot area on macOS