Book Image

Git for Programmers

By : Jesse Liberty
Book Image

Git for Programmers

By: Jesse Liberty

Overview of this book

Whether you’re looking for a book to deepen your understanding of Git or a refresher, this book is the ultimate guide to Git. Git for Programmers comprehensively equips you with actionable insights on advanced Git concepts in an engaging and straightforward way. As you progress through the chapters, you’ll gain expertise (and confidence) on Git with lots of practical use cases. After a quick refresher on git history and installation, you’ll dive straight into the creation and cloning of your repository. You’ll explore Git places, branching, and GUIs to get familiar with the fundamentals. Then you’ll learn how to handle merge conflicts, rebase, amend, interactive rebase, and use the log, as well as explore important Git commands for managing your repository. The troubleshooting part of this Git book will include detailed instructions on how to bisect, blame, and several other problem handling techniques that will complete your newly acquired Git arsenal. By the end of this book, you’ll be using Git with confidence. Saving, sharing, managing files as well as undoing mistakes and basically rewriting history will be a breeze.
Table of Contents (16 chapters)
11
Finding a Broken Commit: Bisect and Blame
13
Next Steps
14
Other Books You May Enjoy
15
Index

Answer

There is no one right way to do this, but we'll walk through a likely answer.

Task #1 – create a private repository on GitHub named Contacts. To do this, open a browser to Github.com and navigate to your repository page. Click on New and fill in the fields as shown here:

Figure 3.32: New repo on server

Notice that I've marked the repository as private. Click the Create Repository button.

Task #2 – clone that repository down to a folder on your disk.

On the same GitHub page, click on Code and click on the clipboard to copy the HTTPS or SSH path (if you have SSH you'll know it, otherwise choose HTTPS):

Figure 3.33: Copy address from server

Open the command line where you want your cloned repo and type:

git clone

and paste in the link you just copied:

git clone [email protected]:JesseLiberty/Contacts.git

You should see something like this:

Figure 3.34: Cloning from server to local repo

...