YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← What Makes a Repository a Repository - How to Use Git and GitHub

Get Embed Code
5 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. Let's jump back into using git.
  2. What makes a git repository a repository?
  3. Last lesson you interacted with an existing repository,
  4. the asteroids repository.
  5. For the most part it just looks like a normal directory on your machine.
  6. The only real difference is that git repositories store a bunch of
  7. metadata about the history of the repository since it was created.
  8. We won't go into the details of how exactly this metadata is stored, but
  9. where is less complicated.
  10. It's right here in the main directory.
  11. But it's tucked away in a hidden directory.
  12. Meaning that it doesn't show up in most file explorers by default.
  13. Hidden files and directories are often used for
  14. data that the user doesn't need to directly interact with.
  15. These directories and files are only different from normal ones in that they
  16. start with a period which tells the operating system to hide it from the users.
  17. One way to see these files is by going to the command line and using ls -a.
  18. In addition to all the normal files that you see when you type ls,
  19. when you do ls -a, you also see the hidden files.
  20. See, here, you have hidden .git.
  21. So, how does this hidden .git directory even get there?
  22. Last time you cloned an existing repository,
  23. which transferred all that metadata over to your computer.
  24. If you want to start from scratch,
  25. you'll need to explicitly tell git that you want to make a new repository.
  26. In the next video Caroline will show you how that works.