top of page

GitHub Copilot - Notes: Part 1

Mitigating AI Risks

  • AI provides benefits (innovation, efficiency) but also introduces risks


Main Risks:

  • Lack of transparency → AI decisions are difficult to understand

  • Bias and harmful outcomes → unfair decisions, privacy issues


Risk Mitigation:

  • Governance frameworks → establish rules and policies for AI use

  • Transparency → ensure AI systems are explainable

  • Human oversight → humans monitor and guide AI decisions


Responsible AI:

  • Approach to building AI that is safe, ethical, and trustworthy

  • Focus on:

    • Fairness

    • Reliability

    • Transparency

  • Keep people at the center of design and decision-making

Microsoft and GitHub’s Six Principles of Responsible AI

  • Six principles guide responsible AI development and use


Principles:

  1. Fairness

    • AI should treat all people equally

    • Avoid bias and unfair outcomes

    • Use balanced data and test across different groups

  2. Reliability and Safety

    • AI must work consistently and as expected

    • Handle unexpected situations safely

    • Minimize physical, emotional, and financial harm

  3. Privacy and Security

    • Protect user data and ensure confidentiality

    • Collect only necessary data with user consent

    • Use anonymization and encryption

    • Restrict and monitor access to sensitive data

  4. Inclusiveness

    • AI should be accessible and usable by everyone

    • Work across diverse populations and regions

    • Support people with disabilities and different languages

    • Ensure no group is excluded

  5. Transparency

    • AI systems should be understandable and explainable

    • Clearly communicate how they work and their limitations

    • Enable auditing, logging, and monitoring

  6. Accountability

    • Humans are responsible for AI systems

    • Monitor performance and manage risks

    • Organizations must take ownership of AI outcomes

GitHub Copilot

  • GitHub Copilot is an AI pair programmer that helps developers write code faster and more efficiently

  • Developed by Microsoft and GitHub in collaboration with OpenAI

  • Powered by OpenAI Codex (trained on large amounts of public code)


Core Benefits:

  • 46% of new code generated by AI

  • 55% faster developer productivity

  • 74% of developers feel more focused


Supported Environments:

  • Works with major IDEs: VS Code, Visual Studio, JetBrains, Vim/Neovim


Key Features:

  1. Code Autocompletion

    • Suggests and completes code and comments in real time

  2. Copilot Chat

    • Ask questions about code

    • Get explanations, generate tests, and documentation

    • Context-aware (understands your project)

  3. Pull Request Summaries

    • Automatically summarizes code changes

    • Improves collaboration and clarity

  4. Code Review Assistance

    • Suggests improvements and identifies issues

    • Helps speed up code reviews

  5. Copilot CLI

    • Suggests commands and scripts

    • Explains terminal output and errors

  6. Copilot Spaces

    • AI collaboration workspace

    • Helps with planning, design, and project understanding

  7. Copilot Coding Agent

    • Executes multi-step coding tasks

    • Can generate files, features, and project scaffolding


Subscription Plans:


Free:

  • Limited usage (code completions + chat requests)

  • Access to advanced models

Pro:

  • Unlimited completions and chat

  • Better performance and features

Pro+:

  • Includes Pro features + higher limits and priority access

Business:

  • For organizations

  • Adds security, policy control, and compliance features

Enterprise:

  • Advanced organizational features

  • Personalized suggestions using internal codebase

  • Deep integration with GitHub

Interact with GitHub Copilot

  • Copilot provides multiple ways to interact and assist during development

  • Works in real time based on your code context


Key Interaction Methods:

  1. Inline Suggestions

    • Real-time code completions as you type

    • Accept: Tab or →

    • Reject: Esc or continue typing

    • Useful for repetitive code and boilerplate

  2. Command Palette

    • Access Copilot features quickly

    • Shortcut: Ctrl+Shift+P (Cmd+Shift+P on Mac)

    • Examples: Explain code, generate tests

  3. Copilot Chat

    • Ask questions in natural language

    • Get code, explanations, and help

    • Context-aware (understands your project)

  4. Inline Chat

    • Context-specific help inside code

    • Shortcut: Ctrl+I (Cmd+I on Mac)

    • Used for edits, explanations, improvements


Slash Commands (used in chat):

  • /explain → explains selected code

  • /suggest → suggests code

  • /tests → generates unit tests

  • /comment → converts comments into code


Other Features:


Comments to Code

  • Write comments → Copilot generates code

Multiple Suggestions

  • Provides alternative solutions

  • Cycle through options (Alt+] / Option+])

Code Explanations

  • Explain selected code blocks

  • Helps understand existing code

Automated Test Generation

  • Generates unit tests for functions/classes

  • Improves code quality and reliability

GitHub Copilot Setup, Configuration, and Troubleshooting


Sign Up for GitHub Copilot:

  • Go to GitHub Settings → Copilot section

  • Start free trial or choose a subscription

  • Install Copilot extension for your environment

  • Supported: VS Code, Visual Studio, JetBrains, Neovim, GitHub.com


Configure in VS Code:


Install Extension:

  • Go to Visual Studio Marketplace → GitHub Copilot

  • Install and open in VS Code

  • Sign in to GitHub when prompted


Enable/Disable Copilot:

  • Use status icon in bottom bar

  • Options:

    • Disable globally

    • Disable for specific language

Inline Suggestions Settings:

  • Go to File → Preferences → Settings

  • Extensions → GitHub Copilot

  • Enable/disable auto completions

  • Can configure per language


Troubleshooting:


Logs:

  • Open Command Palette (Ctrl+Shift+P)

  • Use:

    • Developer: Open Log File

    • Developer: Open Extensions Logs Folder

Advanced Logs:

  • Help → Toggle Developer Tools (Electron logs)

Diagnostics:

  • Command Palette → “GitHub Copilot: Collect Diagnostics”

Common Issues:

  • Network restrictions (firewall/proxy) may block Copilot

  • Use diagnostics to inspect or share with support

 
 
bottom of page