|
|
|
|
|
by philwelch
5104 days ago
|
|
I figured out Git, and I'm not that clever, so don't worry! The staging area (aka the index) is where you put things before they become a commit. You don't always want to commit all of your changes at once. The index is there so you can commit the changes you want instead of just committing all the changes every time. `git commit` means "turn the contents of the index into a commit". A commit is a set of changes that logically go together denoting a version of the repository. A commit needs to have a message describing what the commit does. If you just type "git commit", it opens up an editor for you to type in your commit message. If you want to skip the editor, you can just pass in the -m flag, followed by your commit message in quotes. Are you familiar with the shell? Are you comfortable with the concept of a linked list? If not, work on those--even if you don't use Git, it's part of being a better programmer. But if you do understand these things, you can fairly easily get a very deep understanding of Git. |
|
Place yourself in the shoes of a subversion user, the workflow is very simple and intuitive given that:
Then, a commit is just pushing your modifications to the repository where other people can go get them.Now, with git you don't have a remote repository. Your local copy is itself a repository. Think about this for a second. Then...
If a commit doesn't push my changes to a remote repository, why do I care?
Well, if a commit allows me to have a local history of changes that I may not want to have in the remote repository, why do I need to stage my changes? Why don't I just commit them and be done with that? Isn't the files themselves a stagind area? Isn't this all redundant?
These are the problems a non-Git user faces. Why do I care about this complexity? In what whay does this make the process of making my changes accessible to others easier?
Answer: it doesn't.
Regular people are usually perfectly happy with their other VCS solutions. The ones that want them to see the light and start using Git for all its benefits must thing about what makes Git useful and explain that.
It doesn't matter that Git is important for large distributed projects. Most people aren't a part of large distributed projects.
No tutorial that I can remember does this. Not a single one.