Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a git folder self-contained?

Tags:

git

repository

I'm just starting to use Git, and I have a question:

When I create a new repository I get a folder in which I should put all the files (this folder contains .git folder). Is this folder completely self-contained?

Let's say I've created a new repository and worked on the project for a while (doing commits). If I would take that folder and move it to another location (say another disk) would it still work? What if I move it to another computer? Could I have the repository/folder on an external device (external HDD or USB stick) and work with it on several computers?

like image 666
haagel Avatar asked Jan 06 '13 10:01

haagel


1 Answers

Yes. That is the local repository, and it contains all the information about the repository.

The only thing that's not included is the global configuration.

See this free Git documentation for more details. Quoting from there:

Git creates the .git directory, which is where almost everything that Git stores and manipulates is located. If you want to back up or clone your repository, copying this single directory elsewhere gives you nearly everything you need.

like image 116
Sergiu Dumitriu Avatar answered Oct 12 '22 20:10

Sergiu Dumitriu