4

I have a git repo and I have changes in different directories.

user@box:~/myrepo$ git st
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   emacs/basic.el
    modified:   emacs/elisp.el
    modified:   tips/emacs-tips.org
    modified:   tips/linux-tips.org

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    emacs/wip.el
    tips/sqlite.org

no changes added to commit (use "git add" and/or "git commit -a")

Using command line I can select to show my changes on a selected directory.
For example:

user@box:~/myrepo$ git st emacs/
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   emacs/basic.el
    modified:   emacs/elisp.el

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    emacs/wip.el

no changes added to commit (use "git add" and/or "git commit -a")

How can I do that in magit, if possible?

4

You can filter the status buffer diffs to a directory. Starting from the status buffer, try typing D=f, entering "emacs/", and then g.

  • 1
    Ok, it seems to work, even though the interface is a bit confusing. D stands for Change diffs and =f for Limit to files. I guess I should read magit's manual, to see if it makes more sense. Anyway, thanks! – nephewtom Nov 4 '17 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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