git-index

How to uncommit my last commit in Git [duplicate]

你。 提交于 2019-12-17 17:18:01
问题 This question already has answers here : How do I undo the most recent local commits in Git? (81 answers) Closed 3 years ago . How can I uncommit my last commit in git? Is it git reset --hard HEAD or git reset --hard HEAD^ ? 回答1: If you aren't totally sure what you mean by "uncommit" and don't know if you want to use git reset , please see "Revert to a previous Git commit". If you're trying to understand git reset better, please see "Can you explain what "git reset" does in plain English?".

Undo git update-index --assume-unchanged <file>

我的未来我决定 提交于 2019-12-17 03:44:53
问题 The way you Git ignore watching/tracking a particular dir/file. you just run this: git update-index --assume-unchanged <file> Now how do you undo it so they are watched again? (Let's call it un-assume.) 回答1: To get undo/show dir's/files that are set to assume-unchanged run this : git update-index --no-assume-unchanged <file> To get a list of dir's/files that are assume-unchanged run this : git ls-files -v|grep '^h' 回答2: If this is a command that you use often - you may want to consider having

what is “stat information” in a git index?

♀尐吖头ヾ 提交于 2019-12-10 21:52:04
问题 In git documentation (like git-checkout-index http://linux.die.net/man/1/git-checkout-index ), there are references to "stat information" in the index file. What is this mysterious "stat information"? 回答1: That's information that would be returned by stat() - in particular, file permissions, since that's what's actually tracked. (Other information includes timestamps, filesize, user/group owners, and the inode.) There's also a command-line program stat which is essentially a wrapper for that

Is there a reflog for the index?

旧街凉风 提交于 2019-12-10 14:59:42
问题 I do not have a specific problem at hand, but I have encountered in the past some cases where I accidentally blew up my index, and wished I could go back the the previous state of a given file, which was indexed at some point. Some example cases are : $ git add <file> # find out that I already had an indexed version of <file>, # and that for some reason I shouldn't have added the extra modifications $ git stash pop # find out afterwards that I have a mix of "the index I had" # and "the index

Is the Git staging area just an index?

拥有回忆 提交于 2019-12-09 14:07:41
问题 The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a git commit is done, and now the name index is more commonly known as the "staging area". But if we modify the file foo.txt that is already part of the repo, and use git add foo.txt to stage it, and modify the file again, now the file is both "staged" and "modified" (as seen in git status ), and if we commit, the "staged" version will go into the commit. The second edit won't go

Where does “git update-index --assume-unchanged file” actually save this information to?

别来无恙 提交于 2019-12-09 09:11:41
问题 I like to modify config files directly (like .gitignore and .git/config) instead of remembering arbitrary commands, but I don't know where Git stores the file references that get passed to "git update-index --assume-unchanged file". If you know, please do tell! 回答1: It says where in the command - git update-index So you can't really be editing the index as it is not a text file. Also, to give more detail on what is stored with the git update-index --assume-unchanged command, see the Using

Why is the git index file binary?

醉酒当歌 提交于 2019-12-07 07:29:07
问题 Most of the files in my Git directory are plain text files (except for the compressed loose objects and the packfiles). So I can just cat and edit files like .git/HEAD or .git/refs/heads/master and inspect the repository if it gets corrupted. But the .git/index is a binary file. Wouldn't a plain text file be more useful because it can easily be modified by hand? Scott Chacon shows in his presentation the following image (Slide 278): In my opinion, this can easily be put to a plain text file.

Why is the git index file binary?

做~自己de王妃 提交于 2019-12-05 11:52:58
Most of the files in my Git directory are plain text files (except for the compressed loose objects and the packfiles). So I can just cat and edit files like .git/HEAD or .git/refs/heads/master and inspect the repository if it gets corrupted. But the .git/index is a binary file. Wouldn't a plain text file be more useful because it can easily be modified by hand? Scott Chacon shows in his presentation the following image (Slide 278): In my opinion, this can easily be put to a plain text file. So why is it a binary file rather than a plain text file? VonC The index, as presented in " What does

Is the Git staging area just an index?

别来无恙 提交于 2019-12-03 22:29:06
The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a git commit is done, and now the name index is more commonly known as the "staging area". But if we modify the file foo.txt that is already part of the repo, and use git add foo.txt to stage it, and modify the file again, now the file is both "staged" and "modified" (as seen in git status ), and if we commit, the "staged" version will go into the commit. The second edit won't go in. So how can the "staging area" keep track of what the first edit was if it is just an index -- a

Where does “git update-index --assume-unchanged file” actually save this information to?

不羁岁月 提交于 2019-12-03 12:01:18
I like to modify config files directly (like .gitignore and .git/config) instead of remembering arbitrary commands, but I don't know where Git stores the file references that get passed to "git update-index --assume-unchanged file". If you know, please do tell! manojlds It says where in the command - git update-index So you can't really be editing the index as it is not a text file. Also, to give more detail on what is stored with the git update-index --assume-unchanged command, see the Using “assume unchanged” bit section in the manual Ciro Santilli 新疆改造中心法轮功六四事件 As others said, it's stored