0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cannot determine the organization name for this 'dev.azure.com' remote URLの解決

Last updated at Posted at 2025-02-20

SourceTreeを使って、DevOpsにプッシュしようとしたら、急にできなくなってしまったので、その解決法のメモ書き

  • エラー内容

    git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v origin feature/addMixDisease:feature/addMixDisease
    fatal: Cannot determine the organization name for this 'dev.azure.com' remote URL. Ensure the `credential.useHttpPath` configuration value is set, or set the organization name as the user in the remote URL '{org}@dev.azure.com'.
    fatal: Cannot determine the organization name for this 'dev.azure.com' remote URL. Ensure the `credential.useHttpPath` configuration value is set, or set the organization name as the user in the remote URL '{org}@dev.azure.com'.
    fatal: Authentication failed for 'https://dev.azure.com/hoge'
    Pushing to https://dev.azure.com/hoge
    エラー終了しました。エラーの内容は上記をご覧ください。
    
  • 試したこと

    • SourceTreeを閉じる
    • コマンドプロンプトで以下のコマンドを実行
      git config --global credential.useHttpPath true
    • SourceTreeを開いてプッシュ
  • GPTに聞いた

    credential.useHttpPath true を設定すると?
    この設定を有効にすると、Gitは URLのパスも認証情報のキーとして扱う ようになる。
    
    つまり、認証情報をキャッシュするときに リポジトリごと に記録するようになるんや。
    
    ✅ 設定前(デフォルト)
    
    dev.azure.com だけを認証情報として保存
    組織やリポジトリが異なっても同じ認証情報を使おうとする
    結果的に 組織名が見つからず認証エラー になることがある
    ✅ 設定後(true)
    
    https://dev.azure.com/my-org/my-project/_git/my-repo のように フルパスでキャッシュ
    各リポジトリで 正しい認証情報を使う
    Azure DevOpsでの認証エラーを防ぐ
    

    複数組織を追加している場合に正しいパスをキャッシュするような設定ってことかな。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?