If you want paths specified relative to your current (shell) directory, this does the job: alias gls='git ls-tree -r master -name-only HEAD "`git config core. Git -git-dir "`git rev-parse -git-dir`" -C "`git config core.worktree || pwd`" ls-files If a file is in the staging area, but not committed, it shows with git status. # But you can print all files inside the work tree. git status will return the current working branch. # At this point, `git ls-files` prints only: # Add files at the git repo's root and somewhere in the work tree # Ignore all files by default, else Git will find all files under "/" The ls command lists the current directory contents and by default will not show hidden files. ![]() With -name-status you can get the status symbol too, with -diff-filter you can specify which set of files you want to show A for newly added files, for instance). If you want to see new files you have already added to the index use -cached, otherwise omit it. diff-filterA lists only the added files. ![]() In short, this will work: git -git-dir "`git rev-parse -git-dir`" \ When git status says up-to-date, it means 'up-to-date with the branch that the current branch tracks', which in this case means 'up-to-date with the local ref called origin/master '. You want to use git diff -cached.With -name-only itll list all the files youve changed in the index relative to HEAD. You can use git diff to show the changes. If, for instance, you have a git repo for dotfiles ( core.worktree = /), then you will have files outside the git root and that simple command won't work anymore. How can I restrict git status to regular files in the current directory only 1. Git ls-files will only print files in the current working directory. Is there way to let Git status list to display only directories where files where changes occurred 20.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |