Method: Grit::Repo.init_bare
- Defined in:
- lib/grit/repo.rb
.init_bare(path, git_options = {}, repo_options = {}) ⇒ Object
Public: Initialize a bare git repository (create it on the filesystem).
path - The String full path to the repo. Traditionally ends with
"/<name>.git".
git_options - A Hash of additional options to the git init command
(default: {}).
repo_options - A Hash of additional options to the Grit::Repo.new call
(default: {}).
Examples
Grit::Repo.('/var/git/myrepo.git')
Returns the newly created Grit::Repo.
98 99 100 101 102 103 104 105 |
# File 'lib/grit/repo.rb', line 98 def self.(path, = {}, = {}) = {:bare => true}.merge() git = Git.new(path) git.fs_mkdir('..') git.init() = {:is_bare => true}.merge() self.new(path, ) end |