7 | Committing Changes |
Git tracks changes to your repository through commits, which you
make with the git commit
command. It is
the workhorse of Git and something youâll use a ton.
Prior to most commits, you need to stage the files you want to
commit using the git add
. You can use
it to stage specific changes, portions of files, and other things
that are covered in more detail in Task 6, âStaging Changes to Commitâ.
Each commit requires a commit message. You can use
-m
and a string in quotation marks
as your message or use Gitâs editor to write a message. Thereâs
more information on the editor in Task 2, âConfiguring Gitâ. You can specify multiple
paragraphs by specifying multiple -m
parameters.
You can avoid git add
and ...
Get Pragmatic Guide to Git now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.