There’s plenty more about the internals of Git that we haven’t covered yet. If for some reason you are as part of your normal workflow, you might be doing it wrong. Just one word of wisdom when messing around with Git internals: make sure you know what you’re doing, and if not, have a backup! Messing around with the config files or hooks is pretty simple but I wouldn’t go spelunking in the datastore if I didn’t have to. ![]() refs: The master copy of all refs that live in your repository, be they for stashes, tags, remote tracking branches, or local branches.You can dig into its patch file when it does not apply cleanly if you’re brave. rebase-apply: The workbench for rebasing and for git am.objects: Git’s internal warehouse of blobs, all indexed by SHAs.Seems to be used mostly with the reflog command. logs: Contains history for different branches.We’ve seen this before in the ignoring files article, but as a reminder, you can use this file to ignore files for this project, but beware! It’s not versioned like a. info: Relatively uninteresting except for the exclude file that lives inside of it.An entire series of articles will be coming about hooks. hooks: A directory that will fast become your best friend: this contains scripts that are executed at certain times when working with Git, such as after a commit or before a rebase.From a basic grep through the source, it seems like this file is related to errors when saving refs. RENAMED-REF: Still trying to track this one down.MERGE_MSG: Enumerates conflicts that happen during your current merge.Currently -no-ff is the only constraints passed this way. MERGE_MODE: Used to communicate constraints that were originally given to git merge to git commit when a merge conflicts, and a separate git commit is needed to conclude it.MERGE_HEAD: When doing a merge, this is the SHA of the branch you’re merging from.ORIG_HEAD: When doing a merge, this is the SHA of the branch you’re merging into.packed-refs: Packs away dormant refs, this is not the definitive list of refs in your repository (the refs folder has the real ones!) Take a look at gitster’s comment to see more information on this.index: The staging area with meta-data such as timestamps, file names and also SHAs of the files that are already wrapped up by Git.In most cases it’s probably refs/heads/master HEAD: The current ref that you’re looking at.FETCH_HEAD: The SHAs of branch/remote heads that were updated during the last git fetch.description: If you’re using gitweb or firing up git instaweb, this will show up when you view your repository or the list of all versioned repositories.Specific configuration variables can be dumped in here (and even aliases!) What this file is most used for is defining where remotes live and some core settings, such as if your repository is bare or not. config: Contains settings for this repository.It’s not actually used by Git at all, but it’s there mostly for your reference after you made a commit. COMMIT_EDITMSG: This is the last commit’s message.Let’s go over some of the normal files that you may see living in the base directory: ![]() ![]() Let’s take a look into the important files and folders and try to get a better sense of what’s going on under the hood. If you haven’t been digging around it yet, don’t fret! There’s plenty of goodies to be had within it. One of the things I like best about Git is that it keeps all of its information in one place: your. Thanks for letting me know and keeping me on my toes. ![]() UPDATE: I’ve recieved some very helpful comments regarding corrections to the various files and what they do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |