I've installed git, created a rep, checked in and made changes to some files but I want to know where git stores the repo db and the master files so I can back them up.
Thanks
The contents of the .git folder can be viewed using the tree command in a Windows Operating System. To switch from the git bash terminal to Windows terminal, type the cmd command. The user is presented with the Windows terminal now. Navigate to the .git folder and use the tree command to inspect the contents of this folder.
Retrieve the location (and name value pairs) of the system git configuration file: Retrieve the unique locations of all git configuration files: Regardless from where you use git on Windows, the repository (local) configuration always resides at the same location, in the root directory of your repository: .git\config
What is stored in the .git directory of a git repository is pretty well described in the documentation: * The ‘objects/’ subdirectory, which contains the blobs that represent file data, tree objects, commit objects, and signed tag objects. Together, these make up the data model underlying git. In case it helps others...
The .git folder will contain details of every single change made to the code base. All snapshots of the modifications will be recorded in this folder like a database, which makes it possible to undo the changes and rollback to the desired version of the code. The .git folder is hidden to prevent accidental deletion or modification of the folder.
Git saves everything (local to your current repository) in the .git
folder.
An extensive description can be found on gitready for example.
2 of them you are probably interested in:
- objects: Git’s internal warehouse of blobs, all indexed by SHAs.
- refs: The master copy of all refs that live in your repository, be they for stashes, tags, remote tracking branches, or local branches.
For backups or transferring your local repository, zipping or copying your .git folder is enough.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With