Chapter 11. Git Plumbing and Attributes

In this chapter, we will cover the following topics:

  • Displaying the repository information
  • Displaying the tree information
  • Displaying the file information
  • Writing a blob object to the database
  • Writing a tree object to the database
  • Writing a commit object to the database
  • Keyword expansion with attribute filters
  • Metadata diff of binary files
  • Storing binaries elsewhere
  • Checking the attributes of a file
  • Attributes for exporting an archive

Introduction

Git distinguishes between porcelain commands and plumbing commands. Porcelain commands are the ones you will normally use as add, commit, checkout, rebase, merge, and so on. Plumbing commands are all the helper functions that execute the low-level work. If you run git help in a terminal, you'll get a list of approximately 20 commands—the normal porcelain commands. You can also list all the Git commands with the -a, --all option; this results in about 150 commands.

In the previous chapters of the book, we already used some Git plumbing commands, but without much explanation. In this chapter, we'll take a closer look at some of the more useful commands to display information about files and trees in the repository. We'll also learn how we can create history without the use of the add and commit Git porcelain commands. Finally, we'll look into another area of Git: attributes. We'll see how we can replace keywords or strings in files on add or checkout, how we can diff binary files using textual metadata, and how we can transparently store binary files outside the repository, though added with git add. We'll see how to check the attributes of files in the repository and how we can use attributes while exporting our repository with git archive.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset