Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the convention for the content of an initial/first git commit?

Tags:

git

I know that Git commits should be made for each logical change, but what is the convention (if any exist) for the first commit?

[note: I'm not inviting opinion/discussion on this - if there isn't a common convention then fine].

For instance I've started a website from scratch with index.html - my first 'logical change' commit could be anything from adding the <head> elements, adding the HTML structure, or adding the basic content and CSS. Or should the first commit be the first 'working' version?

Edit: I don't mean the commit message; I mean the content of the files.

like image 784
andydavies Avatar asked Jan 30 '16 15:01

andydavies


People also ask

What should be the first commit in Git?

For brand new projects, there typically aren't yet any code files for Git to track, since the developers haven't written any code yet! In this case, the initial commit usually contains a single file called README.md which is simply a text file describing the purpose of the project.

What is conventional commit?

The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of.


2 Answers

Usually the first commit is named "Initial commit".

As best practice its include a README file describing the project.
The README is usually is a md file.

Just for fun read this: Funny initial git commit messages:

like image 190
CodeWizard Avatar answered Sep 22 '22 13:09

CodeWizard


It seems there is no established convention then (for the content; not the message).

I found this article about best practice useful: https://sethrobertson.github.io/GitBestPractices/

like image 28
andydavies Avatar answered Sep 18 '22 13:09

andydavies