1

How do i see modified lines inside Sublime text 3

7
  • 2
    What's wrong with git diff?
    – Holloway
    Commented Dec 10, 2015 at 12:51
  • it is not clean for big files and i see characters like ^M... wish i had enough reputation to share image.. Here is something i seee !DOCTYPE HTML>^M^M<html>^M^M<head>^M^M<meta charset="utf-8">^M^M<title>4Hire Inc</title>^M^M<meta name="viewport" content="width=device-width, initial-scale=1.0">^M^M^M<link href="{{ asset('css/bootstrap.css')}}" rel="stylesheet" type="text/css" media="screen">^M<link href="{{ asset('css/bootstrap-theme.css')}}" rel="stylesheet" type="text/css"
    – Jay Teli
    Commented Dec 10, 2015 at 13:13
  • 1
    The ^M is the difference between linux and windows line endings. To ignore these use git diff --ignore-space-at-eol.
    – Holloway
    Commented Dec 10, 2015 at 13:17
  • even above command shows same characters ^M .. image attached
    – Jay Teli
    Commented Dec 10, 2015 at 13:20
  • 2
    See here
    – Holloway
    Commented Dec 10, 2015 at 13:26

2 Answers 2

3

Problem solved using Git Gutter

Install Git gutter in Sublime text 3:

cd ~/.config/sublime-text-3/Packages

git clone git://github.com/jisaacks/GitGutter.git

By default, Git Gutter compares your working copy against the HEAD. You can change this behaviour through the ST command palette. The following options are available:

  1. Compare against HEAD
  2. Compare against particular branch
  3. Compare against particular tag
  4. Compare against specific commit

To change the compare option:

Open the command palette (Ctrl-Shift-P for Windows/Linux, Cmd-Shift-P for Mac) Start typing GitGutter You'll see the 4 options listed above, select one with the keyboard. Choose the branch/tag/commit to compare against.

To the left of line numbers we can see the changes add/updated/deleted

0
1

I know this is an old question, but Sublime offers the subl - command for piping output into a new tab.

git diff | subl -

P.S. To show the full file (including unchanged lines), you could try the command given from this SO answer:

git diff -U$(wc -l MYFILE) MYFILE | subl -

Not the answer you're looking for? Browse other questions tagged or ask your own question.