Unlock the Power of GitHub Copilot Workspaces: A Beginner’s Guide

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

GitHub Copilot Workspaces builds on the foundation of Copilot, offering a collaborative environment where teams can leverage AI to enhance their development processes. Unlike the standalone Copilot, Workspaces integrates seamlessly with your development workflow, providing a shared space for code, documentation, and real-time collaboration. 
   

Why Use Copilot Workspaces? 

  1. Enhanced Collaboration: Work together seamlessly with real-time code sharing and editing. 
  2. Improved Code Quality: Leverage AI for intelligent code suggestions and reviews. 
  3. Streamlined Workflows: Integrate with existing tools and processes for a cohesive development environment. 

 
Setting Up Copilot Workspaces 

Prerequisites 

  1. A GitHub account 
  2. GitHub Copilot subscription 
  3. Compatible IDE (e.g., Visual Studio Code) 

Getting Started

Option 1: Open an issue in a GitHub repo and click the “Open in Workspace” button. This will start a new Copilot Workspace session, pre-seeded with the issue as the task, and allow you to iterate on the spec/plan/implementation for it 

 

byansianthony_0-1722856279313.png

 

Option 2: Visit the Copilot Workspace dashboard and start a new session by clicking the “New Session” button. This will allow you to search for a repo and then define an ad-hoc task for it. Effectively like a draft issue. And if you select a template repo, you can define the requirements of a new repo that you create from that. 

byansianthony_1-1722856279316.png

 

 

Iterate on a pull request by clicking the “Open in Workspace” button, defining the change you’d like to make (e.g. “Add checks for potential errors”) and then implementing them. 

byansianthony_2-1722856279333.png

 

Notice the changes suggested by GitHub Copilot

byansianthony_3-1722856279341.png

 

 Open a workspace session in a Codespace, by clicking the “Open in Codespace” button in the header bar or in the “Implementation” panel.  

byansianthony_4-1722856279348.png


Note that your workspace edits will be synced to the Codespace, and any edits you make in the Codespace are synced back to the workspace. This allows you to use VS Code/Codespaces as a companion experience for making larger edits, debugging, etc. 

byansianthony_5-1722856279352.png

 

For instance, replacing `cp -r` with `rsync –av` for more efficient directory copying, changes become reflected in the workspace. 

byansianthony_6-1722856279363.png

 

 Revise the spec, plan, and code with natural language - In addition to making direct edits to the specification or plan. The same capability is also available on the header for changed files, which allows you to revise code based on a specific instruction (e.g. Use $HOME Instead of /home/$USER) and click revise 

byansianthony_7-1722856279373.png


Copilot goes ahead and implements the request file changes which also get reflected in the open Codespaces.

byansianthony_8-1722856279379.png

 

Once you’re satisfied with your changes, you can go ahead and update the PR or select any of the following available options that suite your need. 

byansianthony_9-1722856279387.png

 

Other capabilities provided by GitHub copilot workspaces are file explorer within the browser and an integrated terminal for compiling code, package management and self-customization of the environment. 

other_capabilities.png

Additional Resources 

  1. Step-by-Step: Setting Up GitHub Student and GitHub Copilot as an Authenticated Student Developer.
  2. Learn more GitHub Copilot
  3. Copilot Workspace User Manual

  

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.