Skip to main content

convert_to_bare

Function convert_to_bare 

Source
pub fn convert_to_bare(repo: Repository) -> Result<Repository>
Expand description

Convert a standard git repository into the worktrees layout.

Performs the following steps:

  1. Sets core.bare = true in git config
  2. Renames .git to .bare
  3. Writes a .git link file containing gitdir: ./.bare
  4. Configures origin’s fetch refspec to mirror all branches

Returns the re-opened bare repository.