问题
I am using GibHub private repository. I don't have enough knowledge about it.
What is Git Staging ? what is the purpose of Git Staging ?
When to use Git Staging ?
I found two different options to add file in Git Staging.
- Project Explorer --> Team --> Add to index
- Team Synchronize --> Add to Git Index
Both of them send files to Git Staging. Then What is the difference between these two ? Which is better to user ? Both of them send files to Git Staging.
Thanks.
回答1:
They do the same thing. It's just an inconsistency in the labeling.
I pushed a change for EGit to make this consistent, it will be in the next release (3.5).
回答2:
"Staging" is the process that one performs when selecting which modified files (or portion of files) will be part of the next commit.
The "Index" is the file into which Git stores the files that have been staged. It's also called the "Staging area".
Adding a file to the index is merely saying "Git, this version of this file in my working directory should be part of the next commit I'm about to create".
References:
- Egit - User guide
- ProGit - Recording changes to the repository
来源:https://stackoverflow.com/questions/24677225/what-is-git-staging-and-difference-between-add-to-index-and-add-to-git-index