Statistics
7
Views
0
Downloads
0
Donations
Support
Share
Uploader

高宏飞

Shared on 2026-05-31

AuthorS Basu

This book is a quick study beginner’s guide to Git using GitHub. I have explained all the topics in a simple, concise and easy language with examples, codes and screen shots have tried my best to make the learning process informative and interesting at the same time. If you want to gain an in-depth understanding, it is a simple and short book for the job. In addition, it is a good way to get started with learning Git using GitHub.

Tags
No tags
Publisher: Self-Published
Publish Year: 2021
Language: 英文
Pages: 35
File Format: PDF
File Size: 2.3 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

(This page has no text content)
(This page has no text content)
LEARN GIT WITH GITHUB IN 5 MINUTES Copyright © 2021 S Basu All rights reserved.
Disclaimer: The information and materials presented here are for educational purposes only. Every effort has been made to make this book as complete and as accurate as possible but no warranty or fitness is implied. The information provided is on an "as is" basis. The ideas and opinions expressed are of the author's own imagination and the author is not affiliated to any organization, school or educational discipline and will not be held accountable or liable for any inadvertent misrepresentation.
Contents Chapter 1 : Introduction Chapter 2 : Git installation & setting up GitHub account 2.1: Git Installation 2.2: Setting up GitHub account Chapter 3 : Git clone Chapter 4 : Git add, Git commit & Git push Chapter 5 : Git pull Chapter 6 : Git Merge Conflict Chapter 7 : Git Branching Other important Git commands
Chapter 1 : Introduction What is Git ? Git is a version control tool which helps programmers to keep track of changes made in the project files. Git also helps to synchronize code between a programmer and his/her colleague. Git is a command line tool. Git holds the project code in a Repository . What is a Repository? Git repository contains main project’s source code. What is GitHub? GitHub is an Internet hosting platform for software development and version control using Git . In order words GitHub is simply a website which holds the Git repository which in turn holds the project’s source code. Now let’s install Git and set up the GitHub account.
Chapter 2 : Git installation & setting up GitHub account 2.1: Git Installation In order to download and install Git in our local machine, go to the following website https://git-scm.com/downloads After successful installation, open command prompt and type the command git --version to check the Git version you downloaded. 2.2: Setting up GitHub account
Go to github.com and create a new account -> then click on Create New Repository button as shown in the screen shot below. In create a new repository page, give the Repository name ( suppose hello_world) -> Description -> accessibility (Public or Private ) and click on the Create repository button shown in the screen shot below.
(This page has no text content)
We have successfully created our GitHub repository . In the next chapter we will learn how to add the GitHub repository into our local machine.
Chapter 3 : Git clone In the previous chapter we have successfully created our GitHub repository . In this chapter we will learn how to get a copy of the GitHub repository for our own local machine and have our own local repository. In order to do perform this task Git provides us with git clone command and the syntax is: git clone url, y ou can get the url from GitHub repository page highlighted in the screen shot below. In your local machine, open command prompt -> navigate to any folder or directory where you would like to have your local repository set and type the following command: git clone url Now open the directory or folder where you have cloned the GitHub repository .
The hello_world directory shows. For our local Git repository, let’s set up the name and email address with the help of git config command. In your local machine, open command prompt -> navigate to the hello_world directory and type the following commands: git config --global user.email " youremail@example.com " git config --global user.name " Your Name " In the next chapter we will learn how to add files into our local repository and then push those changes into the main GitHub repository .
Chapter 4 : Git add, Git commit & Git push Whenever you make any changes in the local repository , those changes have no effect in the main GitHub repository . In order to push those changes into the main GitHub repository we need to follow few steps. But before we learn how to do this task, first we need to understand the difference between a working directory and local repository . What is a working directory? A working directory is simply a directory which contains your project files and these files are not tracked by Git . In order to make Git aware and to keep track of these file we need to run git add command. git add command adds the file from the working directory to the staging area . Then git commit is used to save the changes from the staging area into our local repository . What is staging area? Staging area is the area where a file waits to for a commit to occur. In this area a file is tracked and checked by Git for any changes made to it.
Now let’s create a simply HTML (index.html ) file and save it in hello_world directory. Please Note: To create and code index.html we will be using Notepad++ index.html
In order to add index.html into the GitHub repository , we need to follow three steps: Step 1: Use git add command to add the file from working directory to the staging area . The syntax is git add filename In your local machine, open command prompt -> navigate to the hello_world directory and types the following command as shown in the screen shot below. Step 2: Use git commit command to save the changes from staging area into our local repository . The syntax is git commit - m " commit_message " commit_message contains a simple message of what changes you have made to the file.
index.html is now successfully added to our local repository. Step 3: Use git push command to push the changes from our local repository into the main GitHub repository . We have successfully added index.html into the GitHub repository. Refresh the GitHub website repository page and check for the presence of the HTML file.
index.html file shows. Now in the next chapter we will learn how to get the updated new version of index.html from GitHub repository into our local machine.
Chapter 5 : Git pull In the previous chapter we have learnt how to add a file from our local repository to GitHub repository. Now we will learn how to get the latest version of a file from GitHub repository into our local machine. Let’s update the index.html file present in the GitHub repository. Open GitHub repository page -> open index.html file -> click edit as shown in the screen shot below. Add a line of code in index.html -> write the commit messag e -> click on commit changes button as shown in the screen shot below.
Now GitHub repository contains the latest updated version of index.html file. In order to get this new version into our local repository git pull command is used.
In your local machine, open command prompt -> navigate to the hello_world directory and type the command git pull Refresh index.html file in our local machine and you will see the updated version of index.html is added (the line git add <i>filename</i> is present as shown in the screen shot below ).