progit2 icon indicating copy to clipboard operation
progit2 copied to clipboard

Only three states?

Open SimpleSamples opened this issue 6 years ago • 4 comments

The page Git - Git Basics describes "Three States" and I was unsure about what state a file is in when it (the project) is first created. Is it Modified? What state is a file in when it is checked out? Is it initially Modified? But then I read something describing many more states. I think it would help if the basics described the states that are normally encountered in a typical lifecycle of projects, beginning with project creation and then with maintenance. I totally understand and agree that the basics should not be advanced but I think the basics would be easier to understand if it included other basic states.

Am I correct that the states Modified, Staged and Committed correspond with testing, released and implemented? You probably have other terminology you want to use instead of testing, released and implemented but I think it would help to explain the states in that context instead of spending so much time trying to convince beginners that Git is better than other systems.

SimpleSamples avatar Nov 02 '18 21:11 SimpleSamples

To answer your question, when a project is first created, any files in the project are untracked.

"Modified, Staged and Committed" states have nothing to do with "testing, released and implemented". You're mixing up dimensions.

Although I agree that there are parts of this book that could benefit from improvements, I don't at all agree that it spends too much time "trying to convince beginners that Git is better than other systems". You might say that it does try to convince beginners that distributed version control systems are better than what came before.

nobozo avatar Nov 03 '18 18:11 nobozo

I did not say nor imply that the whole book tries to convince the beginner that Git is better than other systems. I am saying that that one page does that instead of explaining other important concepts. The reader is reading that page because they have already decided they want to learn Git. Most of what that page says about version control systems require an understanding of version control systems that the beginner does not have or should be presumed to not have.

SimpleSamples avatar Nov 03 '18 22:11 SimpleSamples

I remember when reading the book for the first time without knowing anything about Git, I also had a slight impression "OK, this is a chapter for old folks who tried some older stuff, what are these other gits even?", though it quickly vanished. On my second read of the book it all made much more sense.

lazarljubenovic avatar Nov 03 '18 22:11 lazarljubenovic

The quick answer

When you first clone a project, all the files in the worktree are "unmodified." If you just ran git init in a directory with existing files, all those files are "untracked."

The real answer

We're really oversimplifying here. The true list of states files can exist in has many, many states, and each file can be in more than one at a time. The goal here is to get a beginner thinking in the right terms, so we can get more exact later.

Your initial point has a lot of merit; adding unmodified to the list you saw would do a lot of good to a brand-new user. Want to submit a PR? I'd love for you to get credit for fixing this.

ben avatar Nov 05 '18 22:11 ben