Java Reference
In-Depth Information
In this chapter we'll add Git to your arsenal. With Git you can change your
code without fear that you'll lose anything or mess anything up. You'll add
these skills to your toolbox:
• How to install Git
• Use Git to keep track of changes to code
• Go back to earlier versions of code (an “undo button”)
• Maintain multiple versions of code at the same time
• Back up your code to the cloud
Git gives you one of the most powerful tools of all: an “undo button” for
your project.
Keep Your Code Safe
By now you might recognize a certain frustrating moment when coding:
everything was working just fine, but you added a couple of lines of code in
a couple of different files, and now nothing works anymore . What changes did
you make? Which one messed everything up? Was it in this file or that one?
Wouldn't it be great to be able to press a sort of giant “undo button,” to toss
out this set of changes that didn't work out so well, and go back to the code
from a few minutes ago that was working all right so you can try again?
Have I got a treat for you.
You can use a tool named Git to do exactly that and more. Git acts like a
huge memory of all the changes you make to your code. You can go back in
time to any previous point, even if you've accidentally deleted a file or renamed
it, moved code from one file to another, and so on—Git will track it all for you.
In addition, you can set it up so that a copy of Git's memory can be backed
up in the cloud, so even if your whole computer gets damaged or stolen, all
of your source code and the full memory of it are safe. You can restore it to
your new computer or a friend's computer and continue on.
You don't have to use this kind of tool, but I really, really recommend it. It's
not hard to set up, and the first time it saves you from stupidly clobbering a
file it will be worth it.
There are tons of tutorials and how-tos for Git on the Web, and a lot of topics
as well, but we'll take a quick pass at the basics here to get you started.
Install Git
First off, you need to download and install the Git software for Windows, Mac,
or Linux from .
Search WWH ::

Custom Search