Skip to content Skip to footer

Some ways to use GitHub Copilot

Writing code is not just about coding. You also need to write commit messages, execute CLI commands, and remember complex syntax. Although you may have already used Copilot to assist you with coding, did you know it can also be helpful for other tasks? 

Copilot is famous for its ability to help write code in their Integrated Development Environment (IDE). However, I would like to demonstrate in this post how the assistant can do more than generate code. We will explore 10 scenarios where Copilot can help to reduce friction in your developer workflow. These include creating pull requests, working from the command line, debugging Continuous Integration/Continuous Deployment (CI/CD) workflows, and more. 

Let's dive in!

Run terminal commands from Copilot Chat

If you ever forget how to run a specific command while working in VS Code, you can use the GitHub Copilot Chat to get help. The new @terminal agent in VS Code can assist you in running the command. Once the agent suggests a response, you can click the “Insert into Terminal” button to execute the command. The @terminal agent has context about the integrated shell terminal, which can provide even more help. Check out https://github.blog/wp-content/uploads/2024/01/01-terminal-chat.mp4 to see how it works.Write pull request summaries (Copilot Enterprise feature only)

We have all experienced the challenge of submitting a large pull request with numerous files and hundreds of changes. However, it can be challenging to remember every detail that we have implemented or modified, which is crucial when collaborating with other engineers or in our team. We need to summarize our proposed changes to provide them with the necessary context for an adequate review. 

Fortunately, GitHub Copilot is now integrated into pull requests, and we can generate a comprehensive summary of the changes we made in our files with the assistance of AI. We can generate these summaries by following the steps outlined in https://github.blog/wp-content/uploads/2024/01/02-PR-Summaries.mp4. This feature gives us an excellent, detailed explanation of all our changes, complete with links to the modified files. 

It is important to note that you will need a Copilot Enterprise plan (which requires Enterprise Cloud) to use PR summaries. You can learn more about this enterprise feature by reading our documentation.

Generate commit messages

    While working in VS Code, I recently discovered a helpful feature of Copilot. This feature helps you generate commit messages right in your IDE. You will notice sparkles in the message input box if you click the source control button. By clicking on those sparkles, commit messages will be generated automatically. 

    This feature of GitHub Copilot in VS Code and Visual Studio is quite impressive. Here is the URL to learn more: https://github.blog/wp-content/uploads/2024/01/03-generate-commits.mp4.

    Get help in the terminal with Copilot in the CLI

      There is another way to receive assistance with terminal commands, which is by utilizing GitHub Copilot in the CLI. It is an extension to GitHub CLI that can aid you with general shell commands, Git commands, and gh cli commands. GitHub Copilot in the CLI is a handy tool that can help you recall commands, teach you new ones, or clarify any obscure commands you encounter online. If you want to learn more about how to get started with GitHub Copilot in the CLI, you can check out this post here: https://github.blog/wp-content/uploads/2024/01/04-gh-cli-copilot.mp4.

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

      Suppose you are in a new repository and need help understanding what is happening, even though the README is available. In that case, you can now use GitHub Copilot Chat to get an explanation of the repository right on GitHub.com. Click on the Copilot icon in the top right corner of the repository and ask any questions you may have about that repository.

      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.

      Please note that to use GitHub Copilot Chat in repositories on GitHub.com, you will need a Copilot Enterprise plan, which requires GitHub Enterprise Cloud. To learn more about this enterprise feature, please read our documentation.

      Fix code inline

      Did you know you can ask for suggestions while coding using Copilot? It's easy! 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 a great feature to have for quickly fixing minor errors in your code. Check out the link below for more information: https://github.blog/wp-content/uploads/2024/01/06-inline-code-copilot.mp4.

      Generate documentation for your code

      Many developers find it beneficial to document their code, but some may require assistance in creating the documentation. Fortunately, GitHub Copilot is available to provide support! With GitHub Copilot, you can quickly generate documentation in various programming languages using the appropriate formats, such as Docstring for Python, JSDoc for JavaScript, or Javadoc for Java. Check out the following link to learn more: https://github.blog/wp-content/uploads/2024/01/08-docs.mp4.

      Get help with error messages in your terminal

      You can use GitHub Copilot to get help if you find error messages confusing. It's now available in your IDE, so you can get assistance with error messages in the terminal. Highlight the error message, right-click, and select “Explain with Copilot”. GitHub Copilot will then provide you with a description of the error and suggest a fix.

      Additionally, you can bring error messages from your browser console into Copilot Chat using the /explain slash command to get an explanation. 

      Here's the link for more information:

      https://github.blog/wp-content/uploads/2024/01/09-terminal-ide.mp4

      Leave a comment

      Newsletter Signup
      Address

      The Grid —
      The Matrix Has Me
      Big Bear Lake, CA 92315

      01010011 01111001 01110011 01110100 01100101 01101101 00100000
      01000110 01100001 01101001 01101100 01110101 01110010 01100101

      Greetings, programs! Together we have achieved a great many things. We have created a vast, complex system.Clu

      Deitasoft © 2024. All Rights Reserved.