![]() (Of course, this is my personal interpretation of the manual. Which means you can also rely on the template being copied immediately after the creation of. Since this is explicitly documented, you can rely on it.įiles and directories in the template directory whose name do not start with a dot will be copied to the $GIT_DIR after it is created. That is to say, git init is guaranteed not to overwrite the HEAD you put in the template, and it won't use the template's HEAD to overwrite an existing HEAD either. The primary reason for rerunning git init is to pick up newly added templates (or to move the repository to another place if -separate-git-dir is given). It will not overwrite things that are already there. Running git init in an existing repository is safe. However, it really doesn't matter what message it shows you. git, rather than relying on whether or not. Reinitialized existing Git repository in įor some reason, git decides whether to use this message based on the presence of the HEAD file in. Then, create the file HEAD in the template dir: $ echo 'ref: refs/heads/default' > ~/Templates/git.git/HEADĪnd you're good to go! Whenever you run git init, you'll now get the message: $ git init ![]() $ cp -r /usr/share/git-core/templates ~/Templates/git.git First, configure your template dir to ~/Templates/git.git (or whatever you'd prefer): $ git config -global init.templateDir '~/Templates/git.git' A simple way to change the default HEAD is to create a HEAD in the git template dir. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |