0% found this document useful (0 votes)
2 views

How to Use GitHub

This document provides a comprehensive guide on how to use GitHub, covering account creation, Git BASH installation, repository creation, and basic Git commands. It includes step-by-step instructions for setting up a GitHub account, cloning repositories, creating branches, and pushing projects to GitHub. Additionally, it explains how to set up a .gitignore file and manage collaborators within a repository.

Uploaded by

MAYUR TADEKAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

How to Use GitHub

This document provides a comprehensive guide on how to use GitHub, covering account creation, Git BASH installation, repository creation, and basic Git commands. It includes step-by-step instructions for setting up a GitHub account, cloning repositories, creating branches, and pushing projects to GitHub. Additionally, it explains how to set up a .gitignore file and manage collaborators within a repository.

Uploaded by

MAYUR TADEKAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

HOW TO USE GITHUB

For Basic use


Table of Contents
Creating GitHub Account.............................................................................................................................................2
Installing Git BASH. .....................................................................................................................................................6
Create a New Repository and Clone it ........................................................................................................................ 10
Create Branch using command .................................................................................................................................. 15
Setup Git Ignore ....................................................................................................................................................... 16
Example to push project to git using commands ......................................................................................................... 17
Creating GitHub Account
Open link: https://github.com/ once loaded below screen is displayed

1. Enter username
2. Enter you valid Email Id
3. Password ( Make sure it's at least 15 characters OR at least 8 characters including a number and a lowercase letter.)

After filling all the information click on Green “Sign up for GitHub” button, if all the information provided in textboxes is
valid it will direct you to next page “Join Github” as Displayed below.
Click on Verify button in above page inside gray box will display an image of animal with rotation arrow on left and right
side of it, use these arrows and make animal stand.

After you rotate animal image properly, “Done” button will be displayed as in below screen.

Click on that Done button, will take you to next page “Welcome to Github”
Check Below Screen Now Step 1 is Checked with Completed, We are currently in Step 2 where Account creation has 2
options

1. Free
2. Pro

By default, Free is selected. (Keep it as it is)

Uncheck all the checkboxes those are displayed below free & Pro rectangular box and Click on continue button.

Once you click on continue button it will display Step 3 with 2 Questions (Not necessary to answer those) directly click
Submit button.
After you clicked on submit button, below page is displayed.

A mail will be sent to your email address ex. In my case I’ve used siddharthsambhaji@outlook.com as my email id at the
time of account creation in first page of sign up. So, email will be sent to “siddharthsambhaji@outlook.com” which is
also displayed in the page.

A verification email will be sent to the same email id, where you need to login (it may be either Gmail or Outlook or
something else) open that corresponding email, where you will find a verification link just click on it will redirect to
GitHub Home. Your account will be activated for use now.
Installing Git BASH.
Open link: https://gitforwindows.org/ once loaded below screen is displayed

Click on the download button, it will start downloading “Git-2.22.0.exe” either 64/32 bit depends on your machine. Once
download is completed. Double click to run the setup file. If A dialog box opens with yes & no button click on Yes will
show you next popup as given below.

Click Next button until 11th screen then press Install button. (we will keep everything as default)

1 2

Click Next Click Next


3 4

Click Next Click Next

5 6

Click Next Click Next

8 9
Click Next Click Next

10 11

Click Next Click Next

12 13

Click Install Installation in Progress


14
After Git Bash Installation is finished. Check you email, you must have received Verfication Mail on your email id as
displayed below:

after you click on Verify email address it will redirect to GitHub as shown below.

Click on “Start a project” button, it will redirect you to Create a new repository page.
Create a New Repository and Clone it

Create a New repository Page

1. Enter Repository Name,


2. Description is optional,
3. Select Private option from radio box as we don’t want our repository to be seen by others.
4. By default, “Initialize this repository with a README” will be checked, let it be.
5. Select “Add .gitignore C++” from 1st drop down list
6. By default, second dropdown is none.
7. Click Create Repository.

If Repository creation is successfully it will take you to below page.


Click on Settings Tab -> Collaborators (from Lest Side Panel)

Now you will see an empty textbox and Add Collaborator button in right hand side panel.

Enter your group leaders Username (GitHub Username), if you type correct username, a drop down will be shown, select
the correct one from listed options. Now click “Add Collaborator” button and it will add the specified user who can now
see your repository. collaborator will automatically receive an invite link in their mailbox, if not received you can use
copy invite link button to share the link with your corresponding group leader.
After you add collaborator below screen will is displayed, we have total of 3 collaborators out of which we will be using
only one.

Now Click on “Code Tab”, you should see green drop down button of “Clone or download”.

1. Click on it will slide down a small panel with Heading “Clone with HTTPS”.
2. In this panel you must see a text box with URL and copy button immediately next to it, click on that copy button
will copy the URL.
Create a folder where you want to Clone Git Repository eg. “C:\WinRT2019”, Inside WinRT2019 folder press right mouse
click. In pop up as shown below you will see “Git Bash Here” option click on it. It will open a MINGW command prompt
window.

Write command “git clone ”, paste the copied link and press enter.
Example: git clone https://github.com/SiddharthSambhaji/WinRT2019.git
Immediately a popup is displayed asking for Username and password. Enter username, password click on login button.

NOTE: Used in examples


Branch Name to be Created: WinRT
GIT URL: https://github.com/SiddharthSambhaji/WinRT2019.git

If successful login, it will clone the repository and below screen will be shown with last line “100%, done” at end.

OR
If you already have created branch and you want to clone it specifically by branch use below command
Create Branch using command
1. git branch <branch Name>: it will Create branch locally

2. git checkout <branch Name>: it will Switch the respective branch

If you must have observed (master) is changed to (WinRT)

OR
1. git branch -b <branch Name>: it will create and Switch branch Same time
Setup Git Ignore
You may see a text file below without any name it is “.gitignore” file where you specify what should be pushed
to GIT.

1. Right click on that file -> edit


2. Open link https://www.gitignore.io/api/visualstudio in your browser
3. Copy the content displayed in browsers page.
4. Remove the old content and Paste the copied content inside edited “.gitigonre” file, and save, then close the
file.

Open git bash command prompt copy and paste below command in git bash and press enter

git config --global alias.ignore \


'!gi() { curl -sL https://www.gitignore.io/api/ visualstudio$@ ;}; gi'
Example to push project to git using commands
1. Create a folder “01-Win32FirstWindow” inside cloned Repository
2. Copy and paste you Project folder i.e “MyWindow” folder inside 01-Win32FirstWindow folder

Below is the Folder structure and files present after you paste project.

3. Now use command git add 01-Win32FirstWindow/

4. Use command git push and press enter.


For First time it will show you suggestion to set your Upstream ex. “git push --set-upstream origin WinRT”
Copy and paste the same command and press enter it will set your Upstream, now use git push and press
Enter, your files will be pushed to GitHub.

NOTE: for more info on commands visit https://git-scm.com/doc link

https://www.microsoft.com/en-in/download/details.aspx?id=48159

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy