DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

using git add -A, but it works only for files that have
been added at some point before in their history; new
files need to be explicitly added to Git tracking. For every
commit, you will need to enter some text about what
changed. If you omit the -m option, Git automatically
launches a text editor (such as vi, which is the default on
Linux and Mac) to allow you to type in the text for your
commit message. This is an opportunity to describe the
changes you made so others know what you did. It’s
tempting to type in something silly like “update” or “new
change for a quick commit,” but don’t fall into that trap.
Think about the rest of your team. Here is an example of
the commit command in action:


Click here to view code image


# git commit -a -m "bug fix 21324 and 23421"
[master e1fec3d] bug fix 21324 and 23421
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 newfile

Note
As a good practice, use the first 50 characters of the
commit message as a title for the commit followed by a
blank line and a more detailed explanation of the
commit. This title can be used throughout Git to
automate notifications such as sending an email
update on a new commit with the title as the subject
line and the detailed message as the body.

Pushing and Pulling Files


Up until this point in the chapter, you have seen how Git
operates on your local computer. Many people use Git in
just this way, as a local version control system to track
documents and files. Its real power, however, is in its
distributed architecture, which enables teams from
around the globe to come together and collaborate on
projects.

Free download pdf