Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are all available Git special files that can be committed to a repository?

Tags:

git

Two examples I can think of are .gitattributes and .gitignore.

Can someone list all of them?

like image 487
sheerun Avatar asked Sep 26 '12 15:09

sheerun


People also ask

What are special files in git?

GitHub uses special files such as README and LICENSE , and special paths such as /. github and /docs , to improve repository managment and developer interactions.

What files should you commit to git?

Your first commit should generally include your . gitignore file. Once again, make sure to avoid pushing any files that you want to ignore when you make that first commit — because GitHub won't know they should be ignored yet.

What kinds of data can be stored in a git repository?

It contains your original data files and all the log messages, author information, dates, and other information required to rebuild any version or branch of the project. Git places only four types of objects in the object store: the blobs, trees, commits, and tags.

What are the 3 git states that a file can be in?

Git has three main states that your files can reside in: modified, staged, and committed: Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.


1 Answers

I grepped the git repository of git itself, and while I don't think an official list exists anywhere, I did notice that all the ones I know about were mentioned in the git-config manpage (git help config). So with that, I did a search for "file" on that page, and here's what I found:

  • .gitignore - List of blobs for git to ignore. Affects commands like git add and git clean.
  • .gitattributes - Let's you define attributes on files (e.g., to change how files look in a diff).
  • .mailmap - Lets you tell git that duplicate names or emails in the history are actually the same person. Affects commmands like git shortlog -ns, or git log --format="%aN <%aE>".
  • .gitmodules - Let's you define submodules (subdirectories of your git repository which are checkouts of other git repositories).
  • *.keep - Something to do with making git gc ignore packs. I couldn't find much info on this, so I'm not even sure if it's a file that you commit to the repository or just something that lives in .git. If someone knows more please comment.

That's all I found. I hope I didn't miss anything.

like image 153
asmeurer Avatar answered Oct 10 '22 02:10

asmeurer