![]() ![]() It includes a log message, which git log or git show will show before any diffs. This includes things like the name and email address of the author of the commit (from user.name and user.email). Commits don't store changes, so when Git shows you changes, it's really doing a git diff of two snapshots.Ī commit also stores some metadata, or information about the commit itself. These appear random, though in fact they're entirely non-random.Ī commit has a full snapshot of every file. Each commit has a big, ugly, incomprehensible hash ID number such as e9e5ba39a78c8f5057262d49e261b42a8660d5b9 (often abbreviated, e.g., e9e5ba3). What you do with this repository is add more commits. Read only if the above still doesn't make sense: If this stuff still doesn't come together, you're probably missing out on a key concept in Git: how the index / staging-area really works.Ī Git repository is, to a large extent, just a big database of commits. I kind of wish that these had not been left in the git switch command, but they were. So git checkout -m is always "dangerous" in the git restore way: it will wipe out uncommitted work without asking. ![]() The first operation cheerfully destroys any merge work you started in the working tree copy of the file. When switching branches with -merge, staged changes may be lost. This second operation is somewhat dangerous: as the documentation now notes,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |