GitHub Essentials
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

Condividi libro
  1. 178 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
GitHub Essentials è disponibile online in formato PDF/ePub?
Sì, puoi accedere a GitHub Essentials di Achilleas Pipinellis in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatik e Webentwicklung. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2018
ISBN
9781789138467
Edizione
2
Argomento
Informatik

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...

Indice dei contenuti