Blog Post

Educator Developer Blog
2 MIN READ

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

byansianthony's avatar
byansianthony
Iron Contributor
Aug 06, 2024

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 

 

 

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. 

 

 

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. 

 

Notice the changes suggested by GitHub Copilot

 

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


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. 

 

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

 

 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 


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

 

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. 

 

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. 

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

  

Updated Aug 05, 2024
Version 1.0
No CommentsBe the first to comment