The GitHub Copilot Handbook (eBook)
290 Seiten
Packt Publishing (Verlag)
978-1-80611-662-1 (ISBN)
Cross-functional product teams are under constant pressure to build and ship faster, but too much time is lost to manual coding, slow reviews, and fragmented workflows. GitHub Copilot streamlines day-to-day coding so your team can focus on delivering value to users while maintaining high quality on real projects.
Written by industry experts Rob Bos and Randy Pagels, this book shows how GitHub Copilot supports your work from start to finish. You'll learn how to turn ideas into tasks, write code with fewer hiccups, spot problems earlier, and understand errors when things go wrong. You'll also see how Copilot suggests improvements in pull requests and helps fix common build issues, enabling teams to keep moving and ship with confidence.
You'll integrate GitHub Copilot into daily routines, share it across roles, and make it stick with simple checklists and clear examples. You'll also track what works, set guardrails, and build an internal community.
By the end, you'll know when GitHub Copilot helps - and when it doesn't - and you'll be ready to write, review, and ship code with confidence on real projects.
1
GitHub Copilot Explained
GitHub Copilot is a service offering from GitHub that helps you to work on your applications in all steps of the software development lifecycle: from ideation, to understanding and writing code, to reviewing your pull requests and analyzing pipeline failures. By using what we call generative Artificial Intelligence (AI), it helps you speed up normal tasks so you can focus on what you do best: adding value to your end users.
GitHub describes Copilot as your pair-programming buddy: a tool that knows almost every coding language, framework, and well-known coding patterns. It can help you with researching both existing and new code directions, can help review your code and suggest improvements, or can complete the task that you have been working on. It intuitively understands your current code and coding style and will follow that to match it. We even think that GitHub Copilot is better than a human pair-programming buddy, as it is a tool that does not judge you on anything you ask about! Can’t remember how to implement an algorithm that you learned years ago? You might be afraid to ask your team members about it, but GitHub Copilot will happily explain it to you – plus, it will explain it in the context of your code base!
Keep in mind that the name of the tool also gives away the most important part of its role in your usage of it: it is a co-pilot, which means you are the pilot, and you are in control. You define the questions you ask it; the scenarios you let it complete; the help you ask it for; and whether you accept the suggestions or not. In the end, the code is stored in a Source Code Management (SCM) system with your name attached to it, not GitHub Copilot’s name.
This book will take you through the impact that GitHub Copilot has on all steps of the Software Development Life Cycle (SDLC), from start to finish. We will explain the features of the tools, the basics of generative AI, and how to leverage GitHub Copilot to get the most value out of it. We will also discuss the different license types that are available and what features they have for either usage in your editor or on the web interface for GitHub.
To get things going, we will take a look at what GitHub Copilot is and what kind of features it provides. It all started as an extension in your coding editor, and it has grown into a full set of features to help you, from writing code to generating completely new ideas, from analyzing pull requests to helping you fix your pipeline errors, and so much more. These features are built into a lot of editors, and some reside inside the web interface on GitHub.com.
In this chapter, we will cover the following topics:
- What is GitHub Copilot?
- Reviewing additional supporting features in editors
- Using GitHub Copilot integrations on GitHub.com
Free Benefits with Your BookYour purchase includes a free PDF copy of this book along with other exclusive benefits. Check the Free Benefits with Your Book section in the Preface to unlock them instantly and maximize your learning experience. |
Technical requirements
To use GitHub Copilot, you do not need to use the rest of the GitHub suite of tools. You can use it in a supported editor of your choosing against any file, no matter where it is stored. If you already use source control systems such as GitLab, Azure DevOps, or Bitbucket, you can still use GitHub Copilot. GitHub is the vendor of the product, but using GitHub itself is not a requirement.
Of course, there is extra functionality available if you use GitHub, which will be explained in depth in Chapter 6. The only integration to be able to use GitHub Copilot is having a GitHub account that you can use to log in and then tie your GitHub Copilot license to it. This tool is even available as a free tier (with some limitations), making it available for all GitHub users. Which features are available in which tier is explained in Chapter 3.
What is GitHub Copilot?
GitHub Copilot is a set of tools that can help you understand or produce code, either by helping you write code in an editor, talking to your code base to gain more information, or getting help from integrated functionality inside the web interface of GitHub.
This all starts with GitHub Copilot leveraging Large Language Models (LLMs) to complete the current line(s) of code that you are working on, by adding a suggestion when you stop typing for a couple of milliseconds, or when you hit the Return key. Depending on your color scheme, a suggestion is shown in gray or dimmed text in the editor, behind your cursor. You can see this in Figure 1.1, where the cursor is on line 9. This is also called “ghost text.” This text is a continuation of the code you already typed, and GitHub Copilot finds the most logical completion of the code and suggests it for you to accept.
Figure 1.1: Example of “ghost text” inside of VS Code
Accepting the code is as simple as hitting the Tab key, and the ghost text will be inserted at your cursor. The cursor will be moved to the end of the text that was inserted. Depending on what you were doing and how confident GitHub Copilot is in the suggestion, you can get either a word, a complete line, or multiple lines of code. It is then completely up to you what you want to do with that suggestion: you can use it as was proposed, you can accept parts of it, or you cannot accept any of it. What we also see is that people read the suggestions and then revise either the direction they were going in or the surrounding code based on new insights.
As well as the suggestion functionality, GitHub Copilot has chat integration, where you can have a conversation with the tool about the currently open files. See Figure 1.2 for an example:
Figure 1.2: Example of a chat conversation with GitHub Copilot
In the chat interface, you can ask anything you can think of – here are some examples:
- What the major elements of the current open code base are
- How you can execute the tests that exist in your project
- To find missing edge cases in your test suite
- Create your pipelines for you in any Continuous Integration/Continuous Deployment (CI/CD) system you need
The possibilities are endless and entirely up to you. The chat interface is a great way to engage with your code. It does not matter whether you are a developer who is just getting started or an experienced engineer: GitHub Copilot offers something for everyone.
We find it especially helpful if you are new to a code base, where GitHub Copilot can help you quickly find your way around the parts that you want to take a look at. Another great use case is when working in a development language that you are not that familiar with: we started contributing to code written in coding languages we did not use before, because GitHub Copilot helps us understand how those languages work. If you understand the basics of programming, such as if statements, for loops, and arrays, you can get very far very fast with GitHub Copilot. Even if you do not fully understand these basics, if you have an exploratory mindset, GitHub Copilot can help guide you through this new environment in a pragmatic way:
- You can ask it to explain these features to you, and it will happily take you through these concepts step by step
- You can quickly find your way around the new code base by asking for an explanation of where the entry point is or how to build the application
- You can let GitHub Copilot explain the application by using diagrams to place the components in the right places for you, so you can quickly learn about the integration points between the backend and frontend
Since GitHub Copilot is that non-judgmental pair programming buddy that can help you with super basic tasks as well as more complex coding concepts, the chat function is a great tool for both people who are new to the field of coding, as well as for experienced engineers, and everything in between.
Having a basic understanding of the underlying technology of generative AI is paramount to having realistic expectations of what value these tools bring to the table. Knowing how GitHub Copilot produces code is explained in Chapter 2. With that knowledge, even more junior engineers can use GitHub Copilot to their advantage in researching and explaining coding concepts in the context of the current code base, where they can pick apart these concepts one by one. Since they understand that they need to double-check what GitHub Copilot produces, they can safely validate their own knowledge and grow their coding skills over time. Normal coding practices still apply, where we guide these engineers through the programming landscape and review the code they produce with that mindset, so they can grow in a safe manner. All this applies equally well to other non-technical stakeholders.
While suggestions and chat...
| Erscheint lt. Verlag | 10.11.2025 |
|---|---|
| Vorwort | April Yoho |
| Sprache | englisch |
| Themenwelt | Informatik ► Theorie / Studium ► Künstliche Intelligenz / Robotik |
| ISBN-10 | 1-80611-662-6 / 1806116626 |
| ISBN-13 | 978-1-80611-662-1 / 9781806116621 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Digital Rights Management: ohne DRM
Dieses eBook enthält kein DRM oder Kopierschutz. Eine Weitergabe an Dritte ist jedoch rechtlich nicht zulässig, weil Sie beim Kauf nur die Rechte an der persönlichen Nutzung erwerben.
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür die kostenlose Software Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür eine kostenlose App.
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich