git-status

How to make git status show only staged files

佐手、 提交于 2019-11-27 06:47:08
I would like to get a list of only the staged filenames. I can't find the equivalent flag for --name-only for the git status command. What is a good alternative? The file list will be piped to php -l (PHP lint syntax checker). Solution: the complete command git diff --name-only --cached | xargs -l php -l Use git diff --name-only (with --cached to get the staged files) The accepted answer won't let you know what kind of changes were there. Yes, If you are not syntax checker but an ordinary person with a repository full of unstaged files, and you still want to know what will happen to staged

Trying to understand `git diff` and `git mv` rename detection mechanism

懵懂的女人 提交于 2019-11-27 05:38:01
This is a followup to another question I asked before . Before being edited, the initially created file something gets renamed to somethingelse which can be observed here : git mv something somethingelse The file somethingelse then gets renamed back to something before the second vim edit: git mv somethingelse something Basically in the following portion of the code : # If you add something to the first line, the rename will not be detected by Git # However, if you instead create 2 newlines and fill line 3 with new code, # the rename gets detected for whatever reason printf "\nCOMMAND: vim

git status shows modifications even with autocrlf=false

感情迁移 提交于 2019-11-27 03:50:19
I'm experiencing the same issues as in this question: git status shows modifications, git checkout -- <file> doesn't remove them Git continues to show working directory modifications, even with git config --global core.autocrlf false : E:\_dev\github\Core [master +0 ~93 -0]> git config --get-all core.autocrlf false false (Note that I've even set the --system setting to be false ) Why does it appear that Git is still modifying my end of lines? Attempts to get rid of modifications Baseline E:\_dev\github\Core [master +0 ~93 -0]> git status # On branch master # Changes not staged for commit: #

Is there a way to tell git-status to ignore the effects of .gitignore files? [duplicate]

跟風遠走 提交于 2019-11-27 01:28:26
问题 This question already has an answer here: Git command to show which specific files are ignored by .gitignore 9 answers I have configured numerous .gitignore files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do git add . when I've got my filtered list looking the way I want it. But, then I want to disable the .gitignore filters temporarily to see what got left behind, and make sure there was nothing important accidentally filtered. I know

Git refuses to reset/discard files

妖精的绣舞 提交于 2019-11-26 18:47:58
问题 I have a project with certain js files which I cannot update. I run OSX locally and my remote/staging server is Linux (CentOS). Right after cloning my project locally, i noticed I have all those files with git status modified . I never modified them, so I tried to discard changes or reset them, but they come up again. The change that is in the modification is deleting all lines and adding them again. I'm not sure why this happens or how to fix it so that my git status is clean as it needs to

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

Trying to understand `git diff` and `git mv` rename detection mechanism

主宰稳场 提交于 2019-11-26 11:40:55
问题 This is a followup to another question I asked before. Before being edited, the initially created file something gets renamed to somethingelse which can be observed here: git mv something somethingelse The file somethingelse then gets renamed back to something before the second vim edit: git mv somethingelse something Basically in the following portion of the code: # If you add something to the first line, the rename will not be detected by Git # However, if you instead create 2 newlines and

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 -

git status shows modifications, git checkout — <file> doesn&#39;t remove them

一个人想着一个人 提交于 2019-11-25 23:24:56
I would like to remove all changes to my working copy. Running git status shows files modified. Nothing I do seems to remove these modifications. E.g.: rbellamy@PROMETHEUS /d/Development/rhino-etl (master) $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: Rhino.Etl.Core/Enumerables/CachingEnumerable.cs # modified: Rhino.Etl.Core/Pipelines/SingleThreadedPipelineExecuter.cs # modified: Rhino.Etl.Tests/Rhino.Etl.Tests.csproj # modified: