git-status

How can I get content of a file from git index?

北慕城南 提交于 2019-12-18 11:08:42
问题 I have a file which has been already added to my local repository. I've modified it in the working tree, so git status shows me the file as modified. I would like to know what is the file content kept in the index before I stage the file. I can think of two ways of doing that: revert a patch generated by git diff, and apply it on the file in the working tree use git checkout-index, point to a temporary file and read the content from there Is there an easier way? 回答1: Use the : prefix to

How to colorize git-status output?

佐手、 提交于 2019-12-18 10:02:10
问题 I want to colorize git-status output so that: untracked files = magenta new files = green modified files = blue deleted files = red I am instead seeing staged files in green and unstaged files in blue: My .gitconfig is setup with the following based on some searching: [color] status = auto [color "status"] added = green changed = blue untracked = magenta deleted = red 回答1: From git config doc: color.status.<slot> Use customized color for status colorization. <slot> is one of: header (the

“fatal: Not a git repository (or any of the parent directories)” from git status

放肆的年华 提交于 2019-12-17 17:36:36
问题 This command works to get the files and compile them: git clone a-valid-git-url for example: git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts However, git status (or any other git command) then gives the above fatal: Not a git repository (or any of the parent directories) error. What am I doing wrong? 回答1: You have to actually cd into the directory first: $ git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts Cloning into 'liggghts'... remote: Counting objects:

How to make git status show only staged files

喜夏-厌秋 提交于 2019-12-17 08:34:09
问题 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 回答1: Use git diff --name-only (with --cached to get the staged files) 回答2: The accepted answer won't let you know what kind of changes were there. Yes, If you are not syntax checker but an

git status shows modifications even with autocrlf=false

让人想犯罪 __ 提交于 2019-12-17 07:17:16
问题 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:\

git status shows modifications, git checkout — <file> doesn't remove them

こ雲淡風輕ζ 提交于 2019-12-16 22:35:32
问题 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

subprocesses from apache returning exit code -6 with not stdout or stderr

社会主义新天地 提交于 2019-12-12 20:03:32
问题 When running "git status" or even "ls" from an apache process, I will frequently get no standard output or error, and an exit status code of -6. Other times, it just works. Any ideas why this is occurring or what it means? 回答1: If you are on a network with a lot of people, you may be running out of available concurrent connections. This assumes you are on Linux when you talk about your remote. The default of 10 concurrent secure collections is not enough if you have lots of simultaneous

“git status” in brief or short format like “ls -1”?

笑着哭i 提交于 2019-12-10 12:44:23
问题 I need to take a bunch of files that have changed and scp them to different boxes for testing. I'm having trouble figuring out how to make git status give me a listing like ls -1 so I can script the actions with minimal effort. I have an existing script that does what I need using ls -1 . I'm not a gifted scripter, so I don't want to modify the script. Instead, I would like the tool to modify its output. Obviously, git status -1 did not work. The format in How can I get 'git status' to always

Strange problem with git repo?

不羁岁月 提交于 2019-12-07 05:21:42
问题 I just upgraded to OSX Lion on my Mac and I aquired a strange problem with a git repo. I have my .vim files under version control with a number of plugins configured as git submodules. After upgrading, I ran a git status command into my .vim directory and got the following: fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed

Strange problem with git repo?

谁都会走 提交于 2019-12-05 12:10:57
I just upgraded to OSX Lion on my Mac and I aquired a strange problem with a git repo. I have my .vim files under version control with a number of plugins configured as git submodules. After upgrading, I ran a git status command into my .vim directory and got the following: fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain failed fatal: git status --porcelain