DELAPARRA
Index
Color
NL
Category: Git commands

git init

Explained by Updated

What is git init?

git init: Create a new, empty Git repository in the current folder. git init creates a new, empty Git repository in the current folder. It adds a hidden .git folder where Git stores all history and configuration. From then on, Git can track changes in that folder. Typical next steps are adding a .gitignore, making a first commit and connecting a remote with git remote add origin <url>.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git init

What should you keep in mind with git init?

Write the .gitignore before the first commit. Folders like vendor and node_modules, build output, log files and especially .env files with secrets should never enter history. Removing a file from a later commit does not remove it from earlier ones, so a committed secret stays in the history until the history itself is rewritten. Most frameworks provide a good starting .gitignore.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.