GitHub Essentials
eBook - ePub

GitHub Essentials

Unleash the power of collaborative development workflows using GitHub, 2nd Edition

Achilleas Pipinellis

Buch teilen
  1. 178 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

GitHub Essentials

Unleash the power of collaborative development workflows using GitHub, 2nd Edition

Achilleas Pipinellis

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

This book will teach you what you need to know to start using GitHub effectively for collaborating and working on your software projects.About This Book• Effectively use GitHub by learning its key features to leverage the power of Git and make collaboration on code easy to work with.• Be more productive on the development workflow of your projects using the valuable toolset that GitHub provides.• Explore the world of GitHub by following simple, step-by-step, real-world scenarios accompanied by helpful, explanatory screenshots.Who This Book Is ForThis book is for experienced or novice developers with a basic knowledge of Git. If you ever wanted to learn how big projects such as Twitter, Google, or even GitHub collaborate on code, then this book is for you.What You Will Learn• Create and upload repositories to your account• Create organizations and manage teams with different access levels on repositories• Use the issue tracker effectively and add context to issues with labels and milestones• Create, access, and personalize your user account and profile settings• Build a community around your project using the sophisticated tools GitHub provides• Create GitHub pages and understand web analyticsIn DetailWhether you are an experienced developer or a novice, learning to work with Version Control Systems is a must in the software development world. Git is the most popular tool for that purpose, and GitHub was built around it, leveraging its powers by bringing it to the web.Starting with the basics of creating a repository, you will then learn how to manage the issue tracker, the place where discussions about your project take place. Continuing our journey, we will explore how to use the wiki and write rich documentation that will accompany your project. You will also master organization/team management and some of the features that made GitHub so well known, including pull requests. Next, we will focus on creating simple web pages hosted on GitHub and lastly, we will explore the settings that are configurable for a user and a repository.Style and approachThis book will take you through some of the most important features of one of the most popular tools, GitHub, which is used to bring developers together from all around the world to discover, share, and build better software. At each step of the way, you will learn about important approaches used in GitHub, including creating a repository, managing teams, creating GitHub pages, and watching your repository's web analytics, among others.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist GitHub Essentials als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu GitHub Essentials von Achilleas Pipinellis im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Webentwicklung. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2018
ISBN
9781789138467
Auflage
2

Collaboration Using the GitHub Workflow

In Chapter 3, Managing Organizations and Teams, we explored how you can create and manage organizations and teams that will further help you in collaborating with others.
GitHub is a great tool for collaboration and, as such, it has come up with a workflow based on the features it provides and the power of Git. It has named it the GitHub workflow (https://guides.github.com/introduction/flow).
In this chapter, we will learn how to work with branches and pull requests, which are the most powerful features of GitHub. Here's what we will cover:
  • Learning about pull requests
  • Peer review and inline comments
  • Merging the pull request
  • Tips and tricks

Learning about pull requests

Pull request is the number one feature in GitHub that made it what it is today. It was introduced in early 2008 and has been used extensively among projects since then.
While everything else can be pretty much disabled in a project's settings (such as issues and the wiki), pull requests are always enabled.

Why pull requests are a powerful asset to work with

Whether you are working on a personal project where you are the sole contributor, or on a big open source project with contributors from all over the globe, working with pull requests will certainly make your life easier.
Think of pull requests like chunks of commits, and the GitHub UI helps you clearly visualize what is about to be merged in the default branch or the branch of your choice. Pull requests are reviewable with an enhanced different view. You can easily revert them with a simple button on GitHub and they can be tested before merging, provided a CI service is enabled in the repository.
CI stands for continuous integration. For more details, you can refer to the applications that GitHub integrates at https://github.com/marketplace/category/continuous-integration.

The connection between branches and pull requests

There is a special connection between branches and pull requests. In this connection, GitHub will automatically show you a button to create a new pull request if you push a new branch in your repository. As we will explore in the following sections, this is tightly coupled to the GitHub workflow, and GitHub uses some special words to describe the from and to branches. As per GitHub's documentation:
The base branch is where you think changes should be applied, the head branch is what you would like to be applied.
So, in GitHub terms, head is your branch, and base is the branch you would like to merge into.

Creating branches directly in a project – the shared repository model

The shared repository model, as GitHub aptly calls it, is when you push new branches directly to the source repository. From there, you can create a new pull request by comparing between branches, as we will see in the following sections.
Of course, in order to be able to push to a repository, you either have to be the owner or a collaborator; in other words, you must have write access.

Creating branches in your fork – the fork and pull model

Forked repositories are related to their parent in a way that GitHub uses in order to compare their branches. The fork and pull model is usually used in projects when you do not have write access, but are willing to contribute.
After forking a repository, you push a branch to your fork and then create a pull request in the parent repository, asking its maintainer to merge the changes. This is common practice for contributing to open source projects hosted on GitHub. You will not have access to their repository, but, being open source, you can fork the public repository and work on your own copy.

How to create and submit a pull request

There are quite a few ways to initiate the creation of a pull request, as we will see in the following sections.
The most common one is to push a branch to your repository and let GitHub's UI guide you. Let's explore this option first.

Using the Compare & pull request button

Whenever a new branch is pushed to a repository, GitHub shows a quick button to create a pull request. In reality, you are taken to the compare page, as we will explore in the next section, but some values are already filled out for you.
Let's create, for example, a new branch named add-gitignore where we will add a .gitignore file with the following content:
git checkout -b add-gitignore echo 'password' > .gitignore git add .gitignore git commit -m 'Add .gitignore' git push origin add-gitignore
Next, head over to your repository's main page and you will notice the Compare & pull request button:
From here on, if you hit this button, you will be taken to the compare page. Note that I am pushing to my repository following the shared repository model, so this is how GitHub greets me:
What would happen if I used the fork and pull repository model? For this purpose, I created an...

Inhaltsverzeichnis