Git Best Practices Guide
eBook - ePub

Git Best Practices Guide

  1. 102 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Git Best Practices Guide

About this book

Git is a powerful versioning system. It is fast and logical, and helps developers to work with a team efficiently. The command set and learning curve of Git are pretty similar to and even better than any other SCM, and therefore it is comparatively easier to learn.

Starting with the basic Git commands, this book will take you on a journey to explore all the features of Git and provide you with a way to integrate Git in a team to set up Agile methods and Continuous Integration.

The book covers how to create and manage a repository on Git before moving on to explain the best practices to work with other developers as a team. It provides descriptions of Git's features, such as applying patch, using submodules, migrating from SVN, hooks, and cherry pick.

This book is invaluable to anyone who wants a thorough reference guide to go back to every time they have questions about any feature of Git.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Git Best Practices Guide by Eric Pidoux in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Git Best Practices Guide


Table of Contents

Git Best Practices Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Starting a Git Repository
Configuring Git
Initializing a new repository
Cloning an existent repository
Working with the repository
Adding a file
Committing a file
Pushing a file
Removing a file
Checking the status
Ignoring files
Summary
2. Working in a Team Using Git
Creating a server repository
Local
SSH
Git
HTTPS
Pushing data on remote repositories – Jim's case
Pulling data from the repository
Creating a patch
Working with branches
Creating a branch
Checking out a branch
Playing with a branch
The difference between branches
Tracking branches
Deleting a branch from the remote
Merging
Fast forward merge
Merge commit
Other merging strategies
Rebase
Cherry-pick
Using tags
Creating and deleting tags
Summary
3. Finding and Resolving Conflicts
Finding content inside your repository
Searching file content
Showing the current status
Exploring the repository history
Viewing changes
Stashing your changes
Cleaning your mistakes
Reverting uncommitted changes
The git reset command
Editing a commit
Canceling a commit
Rewriting commit history
Solving merge conflicts
Searching errors with git bisect
Fixing errors by practical examples
Summary
4. Going Deeper into Git
Migrating an SVN repository to Git
Preparing for SVN to Git migration
Migrating from SVN to Git
Cleaning your commits
Pushing content on Git
Migrating branches and tags
Another easy way to migrate
Using Git within an SVN environment
Setting up your repository
Working with Git SVN
Managing Git submodules
Adding a submodule
Cloning a project with submodules
Removing a submodule
Using a subtree instead of a submodule
Adding a subproject with a subtree
Contributing on a subtree
Creating and applying patches
Creating a patch
Mailing the patch
Applying the patch
Git hooks
Client hooks
Server hooks
More about hooks
Installing a hook
A hook example
Customizing Git
Summary
5. Using Git for Continuous Integration
Creating an efficient branching system
Git flow
Feature branches
Release branches
Hotfix branches
BPF – Branch Per Feature
Working with Continuous Integration using Git
Git tools you might like
Git GUI clients
On Linux
On Windows
On Mac
Repository management
Summary
Index

Git Best Practices Guide

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2014
Production reference: 1141114
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-373-0
www.packtpub.com

Credits

Author
Eric Pidoux
Reviewers
Paulo Alcantara
Edward E Griebel J...

Table of contents

  1. Git Best Practices Guide