What is the folder called .git
?
It's created in a repository. What is contained within it and why is created?
Since all our files are specific to this particular repository, it will find nothing related to it in the parent directory. So, if you have not cloned your project, it is better not to delete the . git folder. Although, you can fetch a few things saved inside the parent directory.
The folder is created when the project is initialized (using git init ) or cloned (using git clone ). It is located at the root of the Git project repository. If we delete the . git folder, the information saved by Git will be lost, and the directory will no longer act as a Git repository.
By default . git directory is hidden inside working directory in windows.
The . git folder contains all the information that is necessary for your project in version control and all the information about commits, remote repository address, etc. All of them are present in this folder. It also contains a log that stores your commit history so that you can roll back to history.
.git is initialized by git init
.
.git contains all information required for version control. If you want to clone your repo, copy .git is enough.
4 sub-directories:
exclude
file for ignored patterns4 files:
Here "object" includes:
The .git
folder contains all the information that is necessary for your project in version control and all the information about commits, remote repository address, etc. All of them are present in this folder. It also contains a log that stores your commit history so that you can roll back to history.
For more info, you can check the official website of git.
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