Join my Laravel for REST API's course on Udemy 👀

What create mode 100644 means in git

June 18, 2022  ‐ 2 min read

Ever noticed something like the following in your terminal after making a git commit?

$ git commit
...
  create mode 100644 src/a-file.md

So there are three parts to the line above:

  • create mode says that a new file was create in your git repository, you may encounter delete mode here as well.
  • 100644 is a bit cryptic way of showing the file permissions, the number 100644 means that this is a regular file.
  • src/a-file.md this one is rather simple, it is the file path of the newly created file in the git repository.

So what is this number 100644? Files can have different 'modes', meaning that files come as different types on your system.

Some files can be executable as a script, others are symlinks and others are regular text files. Each of these types are represented with a number as 100644. You will see the number 120000 for symbolic links for example and 040000 for directories.

On Unix systems we use these permissions to give users and user groups different levels of access to certain files and directories. These types of permissions are not relevant in git, therefore git uses only a subset of the regular file permissions.