Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_init [2018/05/30 12:32] – [Working with the template directory] rpjday | git_init [2019/02/21 12:57] (current) – [Overview (not quite done here)] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Overview ===== | + | ===== Overview |
| - | Basic operation of creating | + | Basic and advanced features for initializing |
| - | ===== Default content of new .git directory ===== | + | ===== Working with the template |
| - | < | + | By default, '' |
| - | . | + | |
| - | ├── branches | + | |
| - | ├── config | + | |
| - | ├── description | + | |
| - | ├── HEAD | + | |
| - | ├── hooks | + | |
| - | │ ├── applypatch-msg.sample | + | |
| - | │ ├── commit-msg.sample | + | |
| - | │ ├── fsmonitor-watchman.sample | + | |
| - | │ ├── post-update.sample | + | |
| - | │ ├── pre-applypatch.sample | + | |
| - | │ ├── pre-commit.sample | + | |
| - | │ ├── prepare-commit-msg.sample | + | |
| - | │ ├── pre-push.sample | + | |
| - | │ ├── pre-rebase.sample | + | |
| - | │ ├── pre-receive.sample | + | |
| - | │ └── update.sample | + | |
| - | ├── info | + | |
| - | │ └── exclude | + | |
| - | ├── objects | + | |
| - | │ ├── info | + | |
| - | │ └── pack | + | |
| - | └── refs | + | |
| - | ├── heads | + | |
| - | └── tags | + | |
| - | </ | + | |
| - | ===== Running "git init" in an existing repository ===== | + | If you don't specify a template directory, the default used is ''/ |
| < | < | ||
| - | Running git init in an existing repository is safe. It will not | + | . |
| - | overwrite things that are already there. The primary reason for | + | ├── branches/ |
| - | rerunning git init is to pick up newly added templates (or to | + | |
| - | move the repository to another place if --separate-git-dir is | + | |
| - | given). | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Working with the template directory ===== | + | |
| - | + | ||
| - | By default, '' | + | |
| - | + | ||
| - | < | + | |
| - | ├── branches | + | |
| ├── description | ├── description | ||
| - | ├── hooks | + | ├── hooks/ |
| - | │ ├── applypatch-msg.sample | + | │ ├── applypatch-msg.sample* |
| - | │ ├── commit-msg.sample | + | │ ├── commit-msg.sample* |
| - | │ ├── fsmonitor-watchman.sample | + | │ ├── fsmonitor-watchman.sample* |
| - | │ ├── post-update.sample | + | │ ├── post-update.sample* |
| - | │ ├── pre-applypatch.sample | + | │ ├── pre-applypatch.sample* |
| - | │ ├── pre-commit.sample | + | │ ├── pre-commit.sample* |
| - | │ ├── prepare-commit-msg.sample | + | │ ├── prepare-commit-msg.sample* |
| - | │ ├── pre-push.sample | + | │ ├── pre-push.sample* |
| - | │ ├── pre-rebase.sample | + | │ ├── pre-rebase.sample* |
| - | │ ├── pre-receive.sample | + | │ ├── pre-receive.sample* |
| - | │ └── update.sample | + | │ └── update.sample* |
| - | └── info | + | └── info/ |
| └── exclude | └── exclude | ||
| </ | </ | ||
| - | You have the option of selecting a different template | + | Rather than accepting |
| + | |||
| + | From the man page for "git init'': | ||
| < | < | ||
| TEMPLATE DIRECTORY | TEMPLATE DIRECTORY | ||
| - | Files and directories in the template directory whose name do | + | Files and directories in the template directory whose name do |
| - | | + | |
| - | | + | |
| - | The template directory will be one of the following (in order): | + | The template directory will be one of the following (in order): |
| - | · the argument given with the --template option; | + | · the argument given with the --template option; |
| - | · the contents of the $GIT_TEMPLATE_DIR environment variable; | + | · the contents of the $GIT_TEMPLATE_DIR environment variable; |
| - | · the init.templateDir configuration variable; or | + | · the init.templateDir configuration variable; or |
| - | · the default template directory: | + | · the default template directory: |
| - | | + | |
| - | The default template directory includes some directory | + | The default template directory includes some directory |
| - | | + | |
| - | | + | |
| - | The sample hooks are all disabled by default, To enable one of | + | The sample hooks are all disabled by default, To enable one of |
| - | | + | |
| </ | </ | ||