Module: Bridgetown::Commands::GitHelpers
Instance Method Summary collapse
Instance Method Details
#destroy_existing_repo ⇒ Object
11 12 13 |
# File 'lib/bridgetown-core/commands/concerns/git_helpers.rb', line 11 def destroy_existing_repo run "rm -rf .git" end |
#initialize_new_repo ⇒ Object
6 7 8 9 |
# File 'lib/bridgetown-core/commands/concerns/git_helpers.rb', line 6 def initialize_new_repo run "git init", abort_on_failure: true `git symbolic-ref HEAD refs/heads/main` if user_default_branch.empty? end |
#user_default_branch ⇒ Object
15 16 17 |
# File 'lib/bridgetown-core/commands/concerns/git_helpers.rb', line 15 def user_default_branch @user_default_branch ||= `git config init.defaultbranch`.strip end |