Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Git Best Practices Guide
  • Table Of Contents Toc
Git Best Practices Guide

Git Best Practices Guide

By : PIDOUX Eric
1 (1)
close
close
Git Best Practices Guide

Git Best Practices Guide

1 (1)
By: PIDOUX Eric

Overview of this book

If you are a developer and you want to completely master Git without heavy theory, this is the book for you. A reasonable knowledge level and basic understanding of Git concepts will get you started with this book.
Table of Contents (7 chapters)
close
close

Creating and applying patches


A patch is a piece of code that can apply a set of changes (that is, a commit) to any branch and any order of a project. The main goal of this feature is to share the changes with other developers, and it gives control to the project maintainer (whether they choose to incorporate the contribution or not). Creating a patch in Git is very easy, as we will see right now.

Creating a patch

Creating a Git format patch will include metadata on the specified commit (author, message, and so on). Everything will be formatted as an easy-to-send e-mail. So, the recipient of this patch will be able to recreate the commit with git am.

In fact, the git format-patch command is useful to transfer a commit. Otherwise, the git diff command finds differences inside the code.

In cases where we want to create a patch for one commit, we have to add the sha1 code of the commit.

The git log command, as we saw in Chapter 2, Working in a Team Using Git, shows the commits:

Erik@server:~$ git...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Git Best Practices Guide
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon