10 unexpected ways to use GitHub Copilot (2024)

Writing code is more than just writing code. There’s commit messages to write, CLI commands to execute, and obscure syntax to try to remember. While you’ve probably used GitHub Copilot to support your coding, did you know it can also support your other workloads?

GitHub Copilot is widely known for its ability to help developers write code in their IDE. Today, I want to show you how the AI assistant’s abilities can extend beyond just code generation. In this post, we’ll explore 10 use cases where GitHub Copilot can help reduce friction during your developer workflow. This includes pull requests, working from the command line, debugging CI/CD workflows, and much more!

Let’s get into it.

1. Run terminal commands from GitHub Copilot Chat

If you ever forget how to run a particular command when you’re working in your VS Code, GitHub Copilot Chat is here to help! With the new @terminal agent in VS Code, you can ask GitHub Copilot how to run a particular command. Once it generates a response, you can then click the “Insert into Terminal” button to run the suggested command.

Let me show you what I mean:

The @terminal agent in VS Code also has context about the integrated shell terminal, so it can help you even further.

2. Write pull request summaries (Copilot Enterprise feature only)

We’ve all been there where we made a sizable pull request with tons of files and hundreds of changes. But, sometimes, it can be hard to remember every little detail that we’ve implemented or changed.

Yet it’s an important part of collaborating with other engineers/developers on my team. After all, if I don’t give them a summary of my proposed changes, I’m not giving them the full context they need to provide an effective review. Thankfully, GitHub Copilot is now integrated into pull requests! This means, with the assistance of AI, you can generate a detailed pull request summary of the changes you made in your files.

Let’s look at how you can generate these summaries:

Now, isn’t that grand! All you have to do is go in and edit what was generated and you have a great, detailed explanation of all the changes you’ve made—with links to changed files!

Note: You will need a Copilot Enterprise plan (which requires GitHub Enterprise Cloud) to use PR summaries. Learn more about this enterprise feature by reading our documentation.

3. Generate commit messages

I came across this one recently while making changes in VS Code. GitHub Copilot can help you generate commit messages right in your IDE. If you click on the source control button, you’ll notice a sparkle in the message input box.

Click on those sparkles and voilà, commit messages are generated on your behalf:

I thought this was a pretty nifty feature of GitHub Copilot in VS Code and Visual Studio.

4. Get help in the terminal with GitHub Copilot in the CLI

Another way to get help with terminal commands is to use GitHub Copilot in the CLI. This is an extension to GitHub CLI that helps you with general shell commands, Git commands, and gh cli commands.

GitHub Copilot in the CLI is a game-changer that is super useful for reminding you of commands, teaching you new commands or explaining random commands you come across online.

Learn how to get started with GitHub Copilot in the CLI by reading this post!

5. Talk to your repositories on GitHub.com (Copilot Enterprise feature only)

If you’ve ever gone to a new repository and have no idea what’s happening even though the README is there, you can now use GitHub Copilot Chat to explain the repository to you, right in GitHub.com. Just click on the Copilot icon in the top right corner of the repository and ask whatever you want to know about that repository.

On GitHub.com you can ask Copilot general software related questions, questions about the context of your project, questions about a specific file, or specified lines of code within a file.

Note: You will need a Copilot Enterprise plan (which requires GitHub Enterprise Cloud) to use GitHub Copilot Chat in repositories on GitHub.com. Learn more about this enterprise feature by reading our documentation.

6. Fix code inline

Did you know that in addition to asking for suggestions with comments, you can get help with your code inline? Just highlight the code you want to fix, right click, and select “Fix using Copilot.” Copilot will then provide you with a suggested fix for your code.

This is great to have for those small little fixes we sometimes need right in our current files.

7. Bulk close 1000+ GitHub Issues

My team and I had a use case where we needed to close over 1,600 invalid GitHub Issues submitted to one of our repositories. I created a custom GitHub Action that automatically closed all 1,600+ issues and implemented the solution with GitHub Copilot.

GitHub Copilot Chat helped me to create the GitHub Action, and also helped me implement the closeIssue() function very quickly by leveraging Octokit to grab all the issues that needed to be closed.

10 unexpected ways to use GitHub Copilot (1)

You can read all about how I bulk closed 1000+ GitHub issues in this blog post, but just know that with GitHub Copilot Chat, we went from having 1,600+ open issues, to a measly 64 in a matter of minutes.

8. Generate documentation for your code

We all love documenting our code, but just in case some of us need a little help writing documentation, GitHub Copilot is here to help!

Regardless of your language, you can quickly generate documentation following language specific formats—Docstring for Python, JSDoc for Javascript or Javadoc for Java.

9. Get help with error messages in your terminal

Error messages can often be confusing. With GitHub Copilot in your IDE, you can now get help with error messages right in the terminal. Just highlight the error message, right click, and select “Explain with Copilot.” GitHub Copilot will then provide you with a description of the error and a suggested fix.

You can also bring error messages from your browser console into Copilot Chat so it can explain those messages to you as well with the /explain slash command.

10. Debug your GitHub Actions workflow

Whenever I have a speaking engagement, I like to create my slides using Slidev, an open source presentation slide builder for developers. I enjoy using it because I can create my slides in Markdown and still make them look splashy! Take a look at this one for example!

Anyway, there was a point in time where I had an issue with deploying my slides to GitHub Pages and I just couldn’t figure out what the issue was. So, of course, I turned to my trusty assistant—GitHub Copilot Chat that helped me debug my way through deploying my slides.

10 unexpected ways to use GitHub Copilot (2)

Read more about how I debugged my deployment workflow with GitHub Copilot Chat here.

GitHub Copilot goes beyond code completion

As you see above, GitHub Copilot extends far beyond your editor and code completion. It is truly evolving to be one of the best tools you can have in your developer toolkit. I’m still learning and discovering new ways to integrate GitHub Copilot into my daily workflow and I hope you give some of the above a chance!

Be sure to sign up for Github Copilot if you haven’t tried it out yet and stay up to date with all that’s happening by subscribing to our developer newsletter for more tips, technical guides, and best practices! You can also drop me a note on X if you have any questions, @itsthatladydev.

Until next time, happy coding!

Tags:

  • AI Insights,
  • generative AI,
  • GitHub Copilot
10 unexpected ways to use GitHub Copilot (2024)

FAQs

10 unexpected ways to use GitHub Copilot? ›

GitHub Copilot analyzes the context in the file you are editing, as well as related files, and offers suggestions from within your text editor. GitHub Copilot is powered by a generative AI model developed by GitHub, OpenAI, and Microsoft. GitHub Copilot is trained on all languages that appear in public repositories.

What can be done using GitHub Copilot? ›

GitHub Copilot analyzes the context in the file you are editing, as well as related files, and offers suggestions from within your text editor. GitHub Copilot is powered by a generative AI model developed by GitHub, OpenAI, and Microsoft. GitHub Copilot is trained on all languages that appear in public repositories.

Why is GitHub Copilot not useful? ›

Dependency Risk: Relying heavily on Copilot may lead to reduced problem-solving skills and overdependence on automated suggestions among developers, especially beginners. Code Quality Variability: While Copilot most often suggests syntactically correct code, the relevance and optimization of the suggestions can vary.

What are some limitations of GitHub Copilot? ›

One of the limitations of Copilot Chat is that it may generate code that appears to be valid but may not actually be semantically or syntactically correct or may not accurately reflect the intent of the developer.

What are the risks of Copilot in GitHub? ›

"Put simply, when Copilot suggests code, it may inadvertently replicate existing security vulnerabilities and bad practices present in the neighbor files," he wrote. "This can lead to insecure coding practices and open the door to a range of security vulnerabilities."

Is GitHub Copilot better than ChatGPT? ›

GitHub Copilot is a better solution than ChatGPT for most coding and programming use cases. In general, GitHub Copilot produces more accurate code outputs, code completions, code snippets, and specific coding requests. It also offers more contextualized information about why certain coding decisions were made.

How do I use GitHub Copilot like a pro? ›

Tips and tricks with GitHub Copilot Chat
  1. Remove irrelevant requests. ...
  2. Navigate through your conversation. ...
  3. Use the @workspace agent. ...
  4. Highlight relevant code. ...
  5. Organize your conversations with threads. ...
  6. Slash Commands for common tasks. ...
  7. Attach relevant files for reference. ...
  8. Start with GitHub Copilot Chat for faster debugging.
Mar 25, 2024

What is better than GitHub Copilot? ›

Several reviewers have compared and contrasted Microsoft's GitHub Copilot and two GitHub Copilot alternatives: Amazon's AWS CodeWhisperer and the Tabnine Copilot. These were identified by TechTarget as the best copilot alternatives for 2024.

What is the controversy with GitHub Copilot license? ›

Plaintiffs further alleged that GitHub and OpenAI knowingly failed to program Copilot to review attribution, copyright notices, and license terms, and that when Copilot makes suggestions that reproduce code subject to open-source licenses, the suggestions would omit attribution, copyright notices, or license terms.

Can GitHub Copilot fix bugs? ›

For more information, see "Quickstart for GitHub Copilot." The GitHub Copilot extension is frequently updated to fix bugs and add new features.

Does GitHub Copilot expose your code? ›

The transmitted data is encrypted both in transit and at rest; Copilot-related data is encrypted in transit using transport layer security (TLS), and for any data we retain at rest using Microsoft Azure's data encryption (FIPS Publication 140-2 standards).

Is it OK to use GitHub Copilot at work? ›

Although GitHub Copilot is a promising tool, it's a bit problematic. We don't discourage you from using it altogether, but we recommend caution, especially if you want to use it to help with your work.

What is the success rate of GitHub Copilot? ›

90% of developers found they were more fulfilled with their job when using GitHub Copilot, and 95% said they enjoyed coding more with Copilot's help. Quickly adopted by developers. Over 80% of Accenture participants successfully adopted GitHub Copilot with a 96% success rate among initial users.

Is GitHub Copilot detectable? ›

GitHub has created a duplication detection filter to detect and suppress GitHub Copilot suggestions that contain code snippets that match public code on GitHub.

Does GitHub Copilot read my data? ›

When you use GitHub Copilot it will collect usage information about events generated when interacting with GitHub Copilot. These events include user edit actions like if Suggestions are accepted or dismissed, and error and general usage data to identify metrics like latency and features engagement.

What types of code can GitHub Copilot generate? ›

GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, or generating suggestions for APIs and frameworks.

Can I use GitHub Copilot for my job? ›

Although GitHub Copilot is a promising tool, it's a bit problematic. We don't discourage you from using it altogether, but we recommend caution, especially if you want to use it to help with your work.

What are the capabilities of Copilot? ›

Copilot includes:
  • Chat with text, voice, and image capabilities.
  • Summarization of documents and web pages.
  • Image creation in Designer (formerly Bing Image Creator).
  • Web grounding.
  • Use of plugins and Copilot GPTs.

Do companies allow GitHub Copilot? ›

Enterprise owners can allow some or all organizations in the enterprise to access GitHub Copilot. If an organization has access to Copilot, owners of the organization can assign Copilot Enterprise seats to some or all members of the organization.

Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 6173

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.