万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    Flutterでなぜかチャンネルがdevにならない

    なぜかstableなチャンネルしかない。

    > flutter channel
    Flutter channels:
    * stable

    どうやっても切り替わらない・・。

    flutter channel dev

    Flutterブランチでこれでもだめ

    git fetch --prune
    > flutter upgrade --force
    Flutter is already up to date on channel stable
    Flutter 1.17.2 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 5f21edf8b6 (3 days ago) • 2020-05-28 12:44:12 -0700
    Engine • revision b851c71829
    Tools • Dart 2.8.3
    > flutter channel dev
    Switching to flutter channel 'dev'...
    git: fatal: 'origin/dev' is not a commit and a branch 'dev' cannot be created from it
    Switching channels failed with error code 128.

    https://stackoverflow.com/questions/54381620/error-when-trying-to-run-flutter-upgrade

    これも試してもだめ。

    git clean -xfd
    git stash save --keep-index
    git stash drop
    git pull

    結果

    Removing bin/cache/
    Removing packages/flutter_tools/.dart_tool/
    Removing packages/flutter_tools/.packages
    Removing packages/flutter_tools/pubspec.lock
    Removing version
    No local changes to save
    No stash entries found.
    Already up to date.

    もしかすると最初これで落としたのかも?

    git clone https://github.com/flutter/flutter.git -b stable --depth 1

    うまく動いてるやつの.git/config設定を見ると

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
            ignorecase = true
            precomposeunicode = true
    [remote "origin"]
            url = https://github.com/flutter/flutter.git
            fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "stable"]
            remote = origin
            merge = refs/heads/stable
    [branch "beta"]
            remote = origin
            merge = refs/heads/beta

    もしかしてfetchの設定かも?

    [remote "origin"]
            url = https://github.com/flutter/flutter.git
            # fetch = +refs/heads/stable:refs/remotes/origin/stable
            # こうする
            fetch = +refs/heads/*:refs/remotes/origin/*