Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I encourage everyone to read A Plumber's Guide to Git: https://alexwlchan.net/a-plumbers-guide-to-git/

It's not a book, just a series of five short blog posts. Part 1 explains precisely where files live: https://alexwlchan.net/a-plumbers-guide-to-git/1-the-git-obj...

  $ mkdir animals

  $ cd animals

  $ git init

  $ echo "Big blue basilisks bawl in the basement" > animals.txt
  
  $ git hash-object -w animals.txt
  b13311e04762c322493e8562e6ce145a899ce570
  
  $ find .git/objects -type f
  .git/objects/b1/3311e04762c322493e8562e6ce145a899ce570

  $ rm animals.txt

  $ git cat-file -p b13311e04762c322493e8562e6ce145a899ce570 > animals.txt
Congratulations, you just did a `git restore animals.txt` manually.

Parts 2 through 5 are equally illuminating.



Thank you a thousand times for sharing that. I just ran through the examples and they were very enlightening.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: