method

git_init_command

Importance_0
v8.1.1 - Show latest stable - 0 notes - Class: AppBase
git_init_command() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/generators/app_base.rb, line 783
      def git_init_command
        if capture_command("git config init.defaultbranch").present?
          return "git init"
        end

        git_version = `git --version`[/\d+\.\d+\.\d+/]

        if Gem::Version.new(git_version) >= Gem::Version.new("2.28.0")
          "git init -b main"
        else
          "git init && git symbolic-ref HEAD refs/heads/main"
        end
      end
Register or log in to add new notes.