What exactly is a git repository?

I am having a little trouble visualizing a git repository.

  1. Does each project get its own git directory (repository)?
  2. Are different branches of a project contained within the same repository?

A git repository is basically a folder inside your project that tracks changes across the code. In most systems it’s a hidden .git folder.

branches are versions of code. So you’ll usually have a Master branch, but then you could have one or multiple branches for things.

So you might have a branch called development where you work on the next iteration of a project. Once you’ve done all you need to do and tested it, you push that development branch to the master branch.

1 Like