Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Git for Programmers

You're reading from  Git for Programmers

Product type Book
Published in Jun 2021
Publisher Packt
ISBN-13 9781801075732
Pages 264 pages
Edition 1st Edition
Languages
Author (1):
Jesse Liberty Jesse Liberty
Profile icon Jesse Liberty
Toc

Table of Contents (16) Chapters close

Preface 1. Introduction 2. Creating Your Repository 3. Branching, Places, and GUIs 4. Merging, Pull Requests, and Handling Merge Conflicts 5. Rebasing, Amend, and Cherry-Picking 6. Interactive Rebasing 7. Workflow, Notes, and Tags 8. Aliases 9. Using the Log 10. Important Git Commands and Metadata 11. Finding a Broken Commit: Bisect and Blame 12. Fixing Mistakes 13. Next Steps
14. Other Books You May Enjoy
15. Index

Answer

Once again, there are many ways to solve this challenge. Here is how I went about it.

Creating a new repository on GitHub

We've seen this before, so I'll do it quickly. I'll navigate to GitHub.com and fill in the usual form, making this demo program public:

Figure 5.16: Creating a new repository

Once you've created the repository, you and anyone else who wants to develop against it (and has the right permissions) can clone it locally.

Creating two feature branches with fake programmers

To do this, I'll create two directories, and clone to each. My first directory I'll call GitHub/DirA and my second GitHub/DirB. I will then clone into each:

Figure 5.17: Cloning the program to the local repository

Only Mateo will program in DirA, and only Kim will program in DirB.

Create a C# program in both DirA and DirB. Once done, use git status to ensure they are both pointing to main. To be certain, make a small...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime