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