Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are git database files stored on windows?

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

like image 889
JamesRedcoat Avatar asked Jul 31 '11 11:07

JamesRedcoat


People also ask

How do I view the contents of a Git file?

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.

Where is the system Git configuration file located on Windows?

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?

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...

What is a Git folder and what does it contain?

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.


1 Answers

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.

like image 190
Kissaki Avatar answered Sep 28 '22 05:09

Kissaki