Azure DevOps Git リポジトリを使う

☁️ Azure DevOps Git リポジトリを使う場合

方法1: ローカルで git init

  • いずれにしても ADS で、New Repogitory でリポジトリ を作っておく
  • npm create vite@latest <your-repo> などを実行
  • cd
  • .gitignore を配置
  • git init
  • npm install などを実行

1. VSCode の Git 操作から Azure DevOps に Push

  • VSCode に Azure DevOps アカウントでログイン(必要に応じて PAT を使用)
  • git remote add origin https://dev.azure.com/xxx/_git/<your-repo>
    • xxx は自分のADS
  • 初回だけ手動 git push -u origin main(または master)
    • ※ 初回用のみ –force が必要な場合がある。
    • git push -u origin main --force

VSCode の右下の「ブランチ名」やソース管理パネルでリモートと同期できます。


方法2: リモートで作ったリポジトリを clone して使う

  • いずれにしても ADS で、New Repogitory でリポジトリ を作っておく
  • git clone https://dev.azure.com/xxx/_git/<your-repo>
  • npm create vite@latest <your-repo> などを実行
    • ※ この時にファイルがあると言われるが、無視して作成を選択
  • cd <your-repo>
  • git branch -aを確認
  • 必要に応じて、git checkout developgit checkout -b develop
  • .gitignore を配置
  • npm install などを実行

あとは普通に使って、git add . して git commit -m "message" して git push