Questions tagged [git-ls-files]
42 questions
2
votes
1 answer
How do I display directories first using git ls-files
I am looking for something similar to the --group-directories-first parameter of ls for the command
git ls-files
Normally, the output is alphabetically sorted and looks like this:
anotherfile.c
directory/file.c
file.c
I want it to look like…

friederbluemle
- 33,549
- 14
- 108
- 109
2
votes
2 answers
How to get the absolute path of all files in a Git repository with submodules?
I am trying to list all untracked files in all submodules recursively:
git submodule foreach --recursive git ls-files --others --exclude-standard --full-name
But this does not list the absolute path, it gives the relative path to the submodule's…

Porcupine
- 5,885
- 2
- 19
- 28
2
votes
1 answer
How to exclude already tracked files from git ls-files?
Our team use flowtype, and git tracked files under the flow-typed directory. I want to hide those files shown by git ls-files.
Those files are already tracked, —exclude option does not seem to work, .git/info/exclude too.
Does anyone have good idea?

yakulto
- 23
- 2
2
votes
2 answers
Rugged equivalent to 'git ls-tree'
In a bare repository I can type $ git ls-tree -r master. (this is sort of the same thing I can get in a none-bare repos with the command git ls-files )
for a full list of files and their sha refs in a git repository.
With Rugged, how do I get that…

Jesper Rønn-Jensen
- 106,591
- 44
- 118
- 155
1
vote
1 answer
Difference between --others and --other in git-ls-files
I want to understand the difference between --others and --other in git-ls-files .
I got same result when i use 'git-ls-files --others --ignored --exclude-standard' and 'git-ls-files --other -ignored --exclude-standard'.

lucku
- 11
- 1
1
vote
0 answers
Files not getting deleted using rsync --delete
rsync --delete does not work if the input for files is given by git ls-files
This is for syncing the two git repositories, wherein one is original and other is rsync backed up version.
I want files from some sub-directories of orig_repo to be synced…

kajalp
- 51
- 5
1
vote
1 answer
What is the Windows command for using git ls-files to copy modified files?
On a unix machine you can run:
cp $(git ls-files --modified) ../modified-files
To copy the modified files to another directory. I'd like to do this on the Windows command line. (This command doesn't work).
My question is: What is the Windows…

hawkeye
- 34,745
- 30
- 150
- 304
1
vote
1 answer
Git - Chaining cmds (i.e. ls-files) to submodules
Is there a way to chain cmds to submodules within your repo? I am looking for built-in methods as I need this to be portable and without secondary installations.
In my case, I have a workflow pipeline that is based on ls-files (and log) and need to…

SushiHangover
- 73,120
- 10
- 106
- 165
0
votes
1 answer
How to show only untracked sub-repos (not files) in git?
How do I show only untracked subdirectories that are git repos? Do I use git diff, git status, or git ls? What options do I use?
The closest thing I could find is:
git diff --name-only --diff-filter=M
but that shows modified, not untracked. And…

Rob Bednark
- 25,981
- 23
- 80
- 125
0
votes
2 answers
How to show only filenames with "git status"?
How do I show only filenames for all modified files in my repository? git status adds additional output, e.g.,
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add ..."…

Rob Bednark
- 25,981
- 23
- 80
- 125
0
votes
1 answer
.gitattributes not setting attr 'text eol' properly
Sample from .gitattributes file that was recently committed.
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ahk text eol=crlf
*.ps1 text eol=lf
Current output of git ls-files --eol below. Note that file a.ps1 is currently a newly…

acegene
- 133
- 1
- 6
0
votes
1 answer
git ls-files run from subdirectory
I'm trying to make a shell.sh that when run with bash will basically just run command: git ls-files -o -i --exclude-standard
which works perfectly when run from base repo directory, but when i change current directory to *repo/folder and run it from…

zecmirit
- 1
- 1
0
votes
1 answer
What is the equivalent git ls-files command to see the same information as git status?
When I merge code and there are conflicts, I have a quick command that lists all the files in the "modified" block of git status. It's a hack using grep and git status.
function gitfix() {
echo 'git status | grep modified:'
}
It's nice because…

Walt Howard
- 7,676
- 1
- 16
- 11
0
votes
2 answers
git ls-files: showing blob files only
How do I use git ls-files to show files only(i.e., excluding directories)?
For instance, I want to remove asd1 and asd2 from the following output:
$> git ls-files
asd1/bar
asd1/foo
asd2/bar
base.html
index.html
list.html
Is…

beep
- 1,057
- 2
- 11
- 23
0
votes
1 answer
How do I get the list of SHA values of all the files in a folder of my git repo using JGit library
I believe that I can get the SHA values of all the files in a folder through command line by using git ls-files -s command. I want to know if there is an equivalent way in JGit Java library?
PS: I don't want to calculate SHA of files…

dj_1993
- 93
- 1
- 8