
GitHub For Dummies
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
For today's coders, GitHub is a must. The world's largest software development platform, GitHub helps developers store, track, and collaborate on software projects. In this easy-to-follow Dummies guide, you'll find insight into creating repositories, establishing projects, collaborating, incorporating open-source resources, and establishing yourself as a valued member of the GitHub community. With a working knowledge of GitHub, you'll be a better, more employable programmer. The simple instructions and interactive examples in this book will get you there quickly.
* Get the instructions you need for using GitHub to collaborate on software projects
* Become more attractive to employers with knowledge and experience in the largest development platform
* Set up GitHub Desktop, create a repository, and launch your first project
* Use GitHub Skills courses to learn new tricks, for beginners to pros
You've learned how to write a little code--now learn how to share it with GitHub.
More details
Other editions
Additional editions

Person
Content
Part 1: Getting Started with GitHub.com 5
Chapter 1: Understanding the Git in GitHub 7
Chapter 2: Setting Up Your Collaborative Coding Environment 25
Part 2: Starting Your First Solo Project 35
Chapter 3: Introducing GitHub Repositories 37
Chapter 4: Setting Up a GitHub Website Repo 57
Chapter 5: Creating a Website with GitHub Pages 73
Part 3: Contributing to Your First Project 91
Chapter 6: Forking GitHub Repositories 93
Chapter 7: Writing and Committing Code 109
Chapter 8: Working with Pull Requests 129
Part 4: Managing and Contributing to Large Projects 149
Chapter 9: Exploring and Contributing to OSS 151
Chapter 10: Starting Your Own OSS 165
Chapter 11: Inner-Source Your Code on GitHub 185
Part 5: Making GitHub Work for You 203
Chapter 12: Collaborating Outside of GitHub 205
Chapter 13: GitHub Workflow Integrations 219
Chapter 14: Personalizing GitHub 233
Part 6: The GitHub Ecosystem 247
Chapter 15: Exploring the GitHub Marketplace 249
Chapter 16: GitHub and You 259
Chapter 17: Attending Events 267
Part 7: The Part of Tens 277
Chapter 18: Ten Ways to Level Up on GitHub 279
Chapter 19: Ten Ways to Improve Your Development Workflow 291
Chapter 20: Ten Tips for Being an Effective Community Member 299
Index 307
Chapter 1
Understanding the Git in GitHub
IN THIS CHAPTER
Getting familiar with GitHub
Discovering Git
Signing up with GitHub.com
Exploring helpful resources
Whether you're an experienced coder or a newbie starting out, learning how to work with others on code is critical to succeeding in the software industry. Millions of people around the world work together to build software, and GitHub is one of the largest tools to support a collaborative workflow. This chapter introduces you to the core tools you need to write code with other people.
Introducing GitHub
GitHub creates an environment that allows you to store your code on a remote server, gives you the ability to share your code with other people, and makes it easy for more than one person to add, modify, or delete code to the same file and project, while keeping one source of truth for that file (phew!). So what does that all actually mean? One of my favorite ways of explaining GitHub.com to folks who are new to the tool is to compare it to Google Docs - a place online where you can write code with other people and not have to email different versions back and forth.
What makes GitHub work behind the scenes is Git.
Understanding Version Control
Version control systems (also known as source control management, or SCM) are software that keep track of each version of each file in a coding project, a timestamp for when that version was created, and the author of those changes.
Writing code is an iterative process. For example, when you're building a website, you first may want to get some basic structure up before adding all your content. The best thing to do is to create a version of your website each time you have something that works. That way, as you experiment with the next piece, if something breaks, you can just go back to your previous version and start over.
SCMs enable coders to make mistakes without worrying that they'll have to completely start over. Think of it like being able to click Undo, but instead of undoing each key press, you can undo an entire piece of the project if you decide you don't like it or it doesn't work.
The basic workflow of coding with version control system support is as follows:
- Create a project, typically in a folder on your computer.
- Tell your version control system of choice to track the changes of your project/folder.
- Each time your project is in a working state, or you're going to walk away from it, tell your version control system of choice to save it as the next version.
- If you ever need to go back to a previous version, you can ask your version control system to revert to whichever previous version you need.
You can use a version control system if you're working alone on your own computer, but it gets even more interesting when you begin working with other people. (For more on working with other people, see the section "Git Version Control," coming up next in this chapter).
For more information about version control, visit https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control.
Git Version Control
GitHub, as the name would suggest, is built on Git. Git is a type of version control system, and it's free and open source, which means that anyone can use it, build on top of it, and even add to it.
GitHub products make using Git easy, but if you're curious, you can also use Git to track your solo projects on your computer. You can find a brief introduction to local Git commands for solo projects in the next section.
Try simple Git on the terminal
With the help of Git for Windows, using the terminal on Mac, Windows, or Linux computers is exactly the same. A terminal is an application that enables you to interact with your computer in a text-based way - in other words, instead of double-clicking and dragging, you type commands to navigate your computer.
If you're on Mac or Linux, a terminal is already installed on your computer. If you're using a Windows computer, you have a couple options:
- You can use the Windows Terminal and install the Windows Subsystem for Linux (WSL) and you can follow the same instructions as a Mac or Linux terminal.
- You can install Git for Windows. Just go to
https://gitforwindows.organd click Download to gain access to Git Bash, an emulator that allows you to interact with Git just like you would on a Linux or Mac terminal. You also get Git GUI, which gives you a user interface for almost all Git commands you might type into Git Bash, and shell integration so that you can quickly open Git Bash or Git GUI from any folder.
Many developers on Windows prefer to use PowerShell as their terminal environment. You can use Git within PowerShell, but setting that up properly is outside the scope of this book. However, you can find a handy guide to setting this up at https://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx.
The Windows Subsytem for Linux (WSL) lets developers run a GNU/Linux environment directly from Windows. You can learn more about it on the Microsoft docs page https://learn.microsoft.com/windows/wsl/.
First, find the Terminal application:
- On Mac, click the magnifying glass at the top right of your desktop, type Terminal, select the terminal from the list of applications, and press Enter or click it.
- On Linux, press Ctrl-Alt-T at the same time, and the terminal window opens.
- On Windows, click the Windows menu in the bottom right of your desktop, search Windows Terminal or Git Bash, select the application from the list of search results, and press Enter or click it.
When the application opens, type git --version in the terminal. If you have Git installed, you should see a version number, as shown in the following code (the $ is a common indicator that the terminal is ready for input and is often already on the line; when you see that throughout this book, you should not type it). Otherwise, you can follow the instructions on https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.
When using the command line, you have to be very careful about exactly what you're typing. In the following code, the first instruction is for you to type git --version. You should note that a space appears between git and the rest of the instruction but no other spaces. You should also note the two dashes before the word version. They can be easy to miss, so be careful!
For Mac or WSL/Linux, you should see something like this:
$ git --version
git version 2.37.2
$
For Windows, you should see something like this:
$ git --version
git version 2.37.2.windows.2
$
Next, using the terminal, go to your desktop and create a new folder called git-practice. To do this, you should type the following commands:
$ cd ~/Desktop
$ mkdir git-practice
$ cd git-practice
$
For Mac or WSL/Linux if you type pwd, you should see that you are now in the folder git-practice, which is on your desktop. It might look something like this:
$ pwd
$ /Users/drguthals/Desktop/git-practice
$
If you're using the command prompt in Windows instead of Git Bash or WSL, you should use cd to print the current directory instead of pwd.
In 2020, GitHub heard the developer community and began a massive renaming project to stop using "master" as the default name for the primary branch of a respository and to use "main" instead. This change has proliferated to Git as well. When you initialize your local folder to use Git, you might be prompted to update your default primary branch name to "main." Whether you are prompted or not, you can update all Git repositories to use "main" as the primary branch name with this command:
$ git config --global init.defaultBranch main
I recommend that you run this config command before you initialize your Git repository so that your primary branch is called main.
Now, you can tell Git to track this folder using the init command.
$ git init
Initialized empty Git repository in /Users/drguthals/Desktop/git-practice
$
Then make sure that you have a clean folder. You can check with the status command:
$ git status
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)
$
Then, you can create a file to have Git start tracking and confirm the file is in the folder:
$ echo "practicing git" > file.txt
$ ls
file.txt
$
On Mac, you can...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.