Azure Reposとの連携によるソースコード管理
Azure ArtifactsをDevOpsの一部に組み込むにあたり、まずはAzure Reposとの連携をしていきます。
リポジトリの作成と初期設定
前回作成したWings.MathLibraryプロジェクトをAzure Reposで管理するため、リポジトリを作成します。Azure DevOpsプロジェクトの左側メニューから「Repos」を選択し、プロジェクト名の右側にある「+」ボタンから「New repository」をクリックします。
リポジトリ設定では以下を指定します。
- Repository name:Wings.MathLibrary
- Repository type:Git
- Initialize with README:チェック
- Add .gitignore:Visual Studio(.NETプロジェクト用)
リポジトリ作成後、Visual Studio Codeでローカルプロジェクトをクローンし、前回作成したライブラリファイルを追加します。
# リポジトリのクローン
git clone https://dev.azure.com/{organization}/{project}/_git/Wings.MathLibrary
cd Wings.MathLibrary
# 前回作成したライブラリファイルをコピー
# (ここでWings.MathLibraryプロジェクトファイルを配置)
# 変更をコミット・プッシュ
git add .
git commit -m "Add Wings.MathLibrary project files"
git push origin main
プッシュに成功し、Azure Reposの画面にファイルが表示されていれば完了です。
