GitHub Essentials
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

Partager le livre
  1. 178 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que GitHub Essentials est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  GitHub Essentials par Achilleas Pipinellis en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatik et Webentwicklung. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2018
ISBN
9781789138467
Édition
2
Sous-sujet
Webentwicklung

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

Table des matiĂšres