tldr/pages/common/git-init.md

21 lines
504 B
Markdown
Raw Normal View History

2015-10-22 08:31:52 +01:00
# git init
2014-03-09 12:20:13 +00:00
> Initializes a new local Git repository.
> More information: <https://git-scm.com/docs/git-init>.
2014-03-09 12:20:13 +00:00
- Initialize a new local repository:
2014-03-09 12:20:13 +00:00
`git init`
- Initialize a repository with the specified name for the initial branch:
`git init --initial-branch={{branch_name}}`
2021-01-07 14:06:38 +00:00
- Initialize a repository using SHA256 for object hashes (requires Git version 2.29+):
`git init --object-format={{sha256}}`
- Initialize a barebones repository, suitable for use as a remote over SSH:
2014-03-09 12:20:13 +00:00
2015-10-22 08:31:52 +01:00
`git init --bare`