GitHub Essentials
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

Compartir libro
  1. 178 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

GitHub Essentials

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

Achilleas Pipinellis

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es GitHub Essentials un PDF/ePUB en línea?
Sí, puedes acceder a GitHub Essentials de Achilleas Pipinellis en formato PDF o ePUB, así como a otros libros populares de Informatik y Webentwicklung. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781789138467
Edición
2
Categoría
Informatik
Categoría
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...

Índice