1

we set up a git for magento site.

and we edited lot of files and now when I used command : git status

I can see as in below images. I want to hide these files from terminal, but I dint want to delete it.

Is there any way I can hide from terminal.

enter image description here

enter image description here

Albert Einstein
  • 7,472
  • 8
  • 36
  • 71
fresher
  • 917
  • 2
  • 20
  • 55

3 Answers3

7

use this

git status -uno

which is equivalent to:

git status --untracked-files=no

It's a bit hidden in the manuals, but the manpage for status says "supports the same options as git-commit", so that's where you'd have to look.

Masood Khaari
  • 2,911
  • 2
  • 23
  • 40
Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
3

I'm not sure I understand what you want to do ?

If you want to view the modifications in a specific subfolder :

git status business/logic/

If you want to hide the lines regarding app/code :

git status | grep -v "app/code"
LeGEC
  • 46,477
  • 5
  • 57
  • 104
2

@Usman Maqbool's answer will work for files that have never been committed yet, and are considered 'untracked' by Git. For files that have already been added to the repo, but you want to ignore local changes, you have 2 options, as discussed here.

I would recommend using the git update-index --skip-worktree [filename] option, as that appears safer.

DeveloperDemetri
  • 208
  • 2
  • 10
  • after running this command `git update-index --skip-worktree' if i edit the same files again, will it come under "modified files" list ? – fresher Feb 26 '16 at 06:03
  • @BabyinCoding did not mentioned about committed files. He just mentioned `git status`. – Usman Maqbool Feb 26 '16 at 06:06
  • I honestly haven't used this myself, but from the command description it looks like Git will ignore any local changes until you go back and run ' git update-index --no-skip-worktree [filename]' on those files. The link that I posted explains more: http://blog.crushingboredom.com/git-the-lesser-known-skip-worktree/ – DeveloperDemetri Feb 26 '16 at 06:07
  • @UsmanMaqbool I am talking about files that have been committed at some point in time by someone, hence they are in the online repo and tracked by Git. Using a .gitignore will do nothing to these files. A .gitignore only tells Git to start ignoring any _new_ files that match the given regex. Please feel free to read more at https://git-scm.com/docs/gitignore – DeveloperDemetri Feb 26 '16 at 06:09
  • http://stackoverflow.com/questions/2363197/can-i-get-a-list-of-files-marked-assume-unchanged seems best solution for it. – Usman Maqbool Feb 26 '16 at 06:10
  • @UsmanMaqbool the link I posted includes the --assume-unchanged and discusses why --skip-worktree is a safer option. Besides, the link you just posted isn't a guide to marking them unchanged, it's a solution for checking which files are marked unchanged. – DeveloperDemetri Feb 26 '16 at 06:13