Visual Studio 2019 で Git エクスペリエンスとチーム エクスプローラーを比較する

Visual Studio 2019 バージョン 16.8 で、Git エクスペリエンスの最初のバージョンを発表しました。 このエクスペリエンスにより、一般的な Git タスクを含むシンプルな [Git 変更] ウィンドウでコンテキストの切り替えを減らすことができます。 また、これには、ブランチの管理やリポジトリの参照など、より高度な Git 操作のための全画面の [Git リポジトリ] ウィンドウも含まれています。

チーム エクスプローラーを使用している場合は、Git エクスペリエンスを使用する方法について、次の手順を追ったガイドを参照してください。

Note

次のセクションでは、テーブルの列に合わせてサイズ変更されたスクリーンショットを示します。 各スクリーンショットをクリックすると、より大きなバージョンが表示されます (タッチスクリーン デバイスを使用している場合は、各スクリーンショットをタップして、より大きなバージョンを表示してください)。

はじめに

チーム エクスプローラー Git エクスペリエンス
リポジトリを複製する Screenshot of the Connect window for Team Explorer in Visual Studio 2019, with a 'clone a repo' procedure overlay. 1.[接続] ページを開きます。
2.[接続の管理] を展開します。
3.[プロジェクトに接続] を選択します。
Screenshot of the Git menu in Visual Studio 2019, with a 'clone a repo' procedure overlay. 1.[Git] メニューを開きます。
2.[リポジトリの複製] を選択します。

レポジトリの切り替え Screenshot of the Connect window for Team Explorer in Visual Studio 2019, with a 'switch between repos' procedure overlay. 1.[接続] ページを開きます。
2.[ローカル リポジトリ] リストからリポジトリを選択します。
Screenshot of the Local Repositories menu item in Visual Studio 2019, with a 'clone a repo' procedure overlay. 1.[Git] メニューを開きます。
2.[ローカル リポジトリ] リストからリポジトリを選択します。
ソリューションを開く Screenshot of the Home window for Team Explorer in Visual Studio 2019, with an 'open a solution' procedure overlay. 1.チーム エクスプローラー[ホーム] ページを開きます。
2.ソリューションのリストからソリューションを選択します。
Screenshot of Solution Explorer in Visual Studio 2019, with an 'open a solution' procedure overlay. 1.ソリューション エクスプローラー[ビューの切り替え] ページを開きます。
2.ソリューションのリストからソリューションを選択します。
ソース コントロールにソリューションを追加し、新しいリポジトリを作成する Screenshot collage of Team Explorer options in Visual Studio 2019, with an Add to Source Control - Create Repo procedure overlay. 1.[ソース コントロールに追加] ステータス バー メニューで [Git] を選択します。
2.[発行] を選びます。
Screenshot collage of Git options in Visual Studio 2019, with an 'add to source control - create repo' procedure overlay. 1.[ソース コントロールに追加] ステータス バー メニューで [Git] を選択するか、最上位の Visual Studio メニュー バーで [Git]>[Create Git Repository]\(Git リポジトリの作成\) を選択します。
2.[Create and Push]\(作成してプッシュ\) を選択します。 : Azure DevOps にコードを追加する場合は、既存のリモート オプションを使用します。 この場合、最初に Azure DevOps リポジトリを作成する必要があります。

ヒント

Git エクスペリエンスは、開いたリポジトリまたはソリューションに基づいて、適切な Azure DevOps リポジトリに自動的に接続されます。 ただし、リポジトリに手動で接続する必要がある場合でも、チーム エクスプローラーを使用してこれを行うことができます。 Visual Studio のメニュー バーで、[表示]>[チーム エクスプローラー]>[接続の管理]>[接続] を選択します。

Git 変更

チーム エクスプローラー Git エクスペリエンス
[Commit and stage]\(コミットとステージ\) Screenshot of the Changes window for Team Explorer in Visual Studio 2019, with a 'commit and stage' procedure overlay. 1.コミット メッセージを入力します。
2.[すべてをコミット] を選択します。
3.特定のファイルをステージングするには、そのファイルを右クリックし、[ステージ] を選択します。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'commit and stage' procedure overlay. 1.コミット メッセージを入力します。
2.[すべてをコミット] を選択します。
3.特定のファイルをステージングするには、そのファイルにカーソルを合わせ、「+」アイコンをクリックします。
コミットの修正 Screenshot of the Changes window for Team Explorer in Visual Studio 2019, with an 'amend a commit' procedure overlay. 1.[アクション] ドロップダウンをクリックします。
2.[以前のコミットを修正] を選択します。
Screenshot of the Git Changes window in Visual Studio 2019, with an 'amend a commit' procedure overlay. 1.[修正] チェックボックスをクリックします。
2.[すべてコミット] をクリックして、更新をコミットします。
変更の一時退避 Screenshot of the Changes window for Team Explorer in Visual Studio 2019, with a 'stash a change' procedure overlay. 1.[一時退避] ドロップダウンをクリックします。
2.関連する [一時退避] オプションを選択します。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'stash a change' procedure overlay. 1.[すべてコミット] ドロップダウンをクリックします。
2.関連する [一時退避] オプションを選択します。

同期

チーム エクスプローラー Git エクスペリエンス
変更のフェッチ、プル、プッシュ Screenshot of the Synchronization window for Team Explorer in Visual Studio 2019, with a 'fetch, pull, and push' procedure overlay. 1.[同期] ページに移動します。
2.選択したネットワーク操作をクリックします。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'fetch, pull, and push' procedure overlay. 1.[Git 変更] ウィンドウで、フェッチ、プル、プッシュの各ボタンを探します。
2.選択したネットワーク操作をクリックします。
着信および発信コミットの表示 Screenshot of the Synchronization window for Team Explorer in Visual Studio 2019, with a 'view incoming and outgoing commits' procedure overlay. 1.[同期] ページに移動します。
2.着信および発信リストを表示します。
Screenshot of the Git Changes window and the Git Repository window in Visual Studio 2019, with a 'view incoming and outgoing commits' procedure overlay. 1.[Git 変更] ウィンドウで、発信または着信リンクをクリックします。
2.[Git リポジトリ] ウィンドウの上部にあるグラフ テーブルのアイコンを使用して、着信および発信コミットを表示します。

ブランチ

チーム エクスプローラー Git エクスペリエンス
分岐を作成する Screenshot of the Branches window for Team Explorer in Visual Studio 2019, with a 'create a new branch' procedure overlay. 1.[ブランチ] ウィンドウに移動します。
2.[新しいブランチ] をクリックします。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'create a new branch' procedure overlay. 1.[Git 変更] ウィンドウで、ブランチ ドロップダウン リストをクリックします。
2.[新しいブランチ] をクリックします。
リモート ブランチからの最近の変更の取得 Screenshot of the Branches window for Team Explorer in Visual Studio 2019, with a 'get recent changes from remote branch' procedure overlay. 1.[ブランチ] ページに移動します。
2.リモート ブランチを右クリックし、[マージ元] または [Rebase Onto]\(リベース先\) を選択します。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'get recent changes from remote branch' procedure overlay. 1.ブランチ ドロップダウン リストをクリックします。
2.[リモート] タブでリモート ブランチをクリックし、[Merge into Current Branch]\(現在のブランチにマージ\) または [Rebase Current Branch onto]\(現在のブランチのリベース先\) を選択します。
ブランチを管理する Screenshot of the Branches window for Team Explorer in Visual Studio 2019, with a 'manage branches' procedure overlay. 1.[ブランチ] ウィンドウに移動します。
2.管理するブランチを右クリックします。
3.ブランチの履歴を表示して、コミットを管理します。
Screenshot collage of how three UI options to use to manage branches in Visual Studio 2019. 1.次のいずれかのエントリ ポイントを使用して、[Git リポジトリ] ウィンドウに移動します。

a. 最上位の Visual Studio メニューで、[Git]>[ブランチの管理] を選択します。
b. [Git 変更]>[着信/発信] を選択します。
c. 右下にあるステータス バー メニューで、[ブランチの管理] を選択します。

2.最上位の [Git]>[ブランチの管理] メニューで、次のいずれかの操作を実行します。

A。 ブランチを右クリックします。
B. 管理するコミットを複数選択します。

競合の解決

チーム エクスプローラー Git エクスペリエンス
競合のあるファイルのリストへのアクセス Screenshot collage of the Changes window and the Resolve Conflicts window for Team Explorer in Visual Studio 2019, with a procedure overlay. 1.[競合] リンクをクリックして、[競合の解決] ウィンドウに移動します。
2.[競合] リストを使用して、マージの競合を解決します。
Screenshot of the Git Changes window in Visual Studio 2019, with a 'resolve conflicts' procedure overlay. 1.[Merge in progress with conflicts]\(競合のあるマージが進行中\) が表示されることを確認します。
2.[Git 変更] ウィンドウの [Unmerged Changes]\(マージされていない変更\) セクションに、マージの競合があるファイルのリストが表示されます。
競合を解決します。