git-ls-files

Is comparing git lfs ls-files with git ls-files ':(attr:filter=lfs)' a reliable way to detect lfs files that are not managed by lfs?

▼魔方 西西 提交于 2019-12-04 05:48:58
I try to find a way to determine whether the files in git repository are correctly managed by git-lfs. So far, I have found that comparing results from git lfs ls-files and git ls-files ':(attr:filter=lfs)' seems to give me what I want. Add-Type -AssemblyName 'System.Linq'; [string[]] $actualLfsFilePaths = git lfs ls-files | ` ForEach-Object ` { #'12345678 * my.dll' - not all lfs versions support -n flag, so it is better to be conservative $_.Split(' ', 3)[2] }; [string[]] $shouldBeUnderLfsFilePaths = git ls-files ':(attr:filter=lfs)'; $filePathsNotUnderLfs = [System.Linq.Enumerable]::ToArray(

git ls-files in bare repository

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 04:45:41
问题 I want to access a bare git repository, and I want to list all files in the repository. On a normal git repository I can easily do that by running git ls-files . Example output: $ git ls-files README.md file1.js file2.js file3.js folder1/file4.js folder2/file5.js In a bare git repository this fails silently. It just doesn't return any files (but exits successfully): $ cd my-bare-repository $ git ls-files #returns nothing $ echo $? #print exit code from previous command $ 0 Now I am aware that

git ls-files in bare repository

ε祈祈猫儿з 提交于 2019-12-02 17:57:32
I want to access a bare git repository, and I want to list all files in the repository. On a normal git repository I can easily do that by running git ls-files . Example output: $ git ls-files README.md file1.js file2.js file3.js folder1/file4.js folder2/file5.js In a bare git repository this fails silently. It just doesn't return any files (but exits successfully): $ cd my-bare-repository $ git ls-files #returns nothing $ echo $? #print exit code from previous command $ 0 Now I am aware that I have to provide a meaningful branch or master to display. But how can I actually get this list of

git add wont stage files - git cache confused?

我的未来我决定 提交于 2019-12-02 12:11:56
I have a feeling my git cache is getting confused fairly often. I work on Mac and use both git at terminal and SourceTree. I add or modify few files but I often notice that even files I have never modified in any way show as staged. This is very confusing already. However, even more confusing is that often issuing git add . to add all of the files to staging area does nothing. I have been using git for few years and have never had this before. I read all posts here on SO and none of them resolved this issue for me. I found one suggestion to clear git cache like: git rm --cached path/to/file

Git: list only “untracked” files (also, custom commands)

£可爱£侵袭症+ 提交于 2019-11-26 18:00:33
Is there a way to use a command like git ls-files to show only untracked files? The reason I'm asking is because I use the following command to process all deleted files: git ls-files -d | xargs git rm I'd like something similar for untracked files: git some-command --some-options | xargs git add I was able to find the -o option to git ls-files , but this isn't what I want because it also shows ignored files. I was also able to come up with the following long and ugly command: git status --porcelain | grep '^??' | cut -c4- | xargs git add It seems like there's got to be a better command I can

Git: list only “untracked” files (also, custom commands)

孤人 提交于 2019-11-26 08:57:35
问题 Is there a way to use a command like git ls-files to show only untracked files? The reason I\'m asking is because I use the following command to process all deleted files: git ls-files -d | xargs git rm I\'d like something similar for untracked files: git some-command --some-options | xargs git add I was able to find the -o option to git ls-files , but this isn\'t what I want because it also shows ignored files. I was also able to come up with the following long and ugly command: git status -