OVERVIEW OF GITHUB
By Sangeetha Subramani
Software Specialist
TABLE OF CONTENTS
Introduction
Install Git and Create Profile in Github
website
Starting a Fresh Project
Creating Repository
Using Repository in Git
Checking Repository created in local
Adding File in Git
Change Script File and Save Modified File in
Local
Push Data/Code
Basic Command to display changes made
Creating Branches GITHUB OVERVIEW 2
Introduction
 Git is a version control software application
created by Linus Torvalds (the creator of
Linux) with the collaboration of many other
developers.
 A version control application keeps track of
all the changes that you do in the files of
your project. Every time you make changes
to files of a project, you can push those
changes to a repository. Other developers
can pull your changes from the repository
and continue to work with the improvements
that you added to the project files.
 This document is useful for those who has
zero knowledge on Git. You can have a
look at basic git commands here in this
document.
GITHUB OVERVIEW 3
 Install Git from http://gitforwindows.org/
 Open command prompt and run “cmd”
 Enter the command “git version”. User
should be able to view the version of git
installed
GITHUB OVERVIEW 4
Install Git and Create Profile in Github
website
Creating Git Profile
 Create Git profile by login to the below
website https://github.com/login
 Your page will look like this. Click on “Your
Profile” to check for your repository. We will
see this screenshot once we create
repository
GITHUB OVERVIEW 5
Fresh Project
 Create project folder in local PC and open
this path in command prompt
 Run “git init” in the command prompt
 “.git” file is created locally.
GITHUB OVERVIEW 6
Continued..
 The “.git” file consist of config and other
files which are mentioned below in the
attachment.
GITHUB OVERVIEW 7
Creating Repository
 Login to github webpage and click on “New”
button to create New repository.
 Provide Repository name eg “Basic_Program”
 Description(Optional): Basics
 Select Public radio button(Access to public).
Selecting Public or Private radio button is user
specific. User can select Private also.
GITHUB OVERVIEW 8
Continued..
 Finally click on “Create Repository” button.
GITHUB OVERVIEW 9
Continued…
 URL is created based on our inputs while
creating repository. once the repository is
created, Copy the url.
 Here I have shown my newly created url for
https selection.
GITHUB OVERVIEW 10
Using Repository in Git
 Once the url is copied, navigate to command
prompt type git clone and paste url
Eg: “ git clone
https://github.com/sangeethas1989/Basic_Progr
am.git”
GITHUB OVERVIEW 11
Checking the repository created in local
 Basic_Program file is created under
specified path.
 User can check by providing “git status”
command in command prompt to know the
status of what is happening.
GITHUB OVERVIEW 12
Checking the status
 I am just checking the current status here
with the command “git status” . Attached
screenshot for the status.
GITHUB OVERVIEW 13
Adding file in Git
 I have added python code/script file under
my folder “Basic_Program” locally as
shown below.
Use below command to move to github.
 “git add helloworld.py”
OR
 You can specify file path of helloworld.py
Eg “git add FiePathOfHelloworldFile”
GITHUB OVERVIEW 14
Continued…
 NOTE:
Use below command if you have multiple file to
be added.
“git add .”
I have attached screenshot of command
prompt where you can view the details.
GITHUB OVERVIEW 15
Continued…
 User can go to Git profile and check if the
file is added or not. “Basic_Program is the
file which has been added now.
GITHUB OVERVIEW 16
Change script File & save Modified file in
local
 User can modify the script file and can save
file with the help of below command
 “git commit –am “FirstCommit”
GITHUB OVERVIEW 17
Continued…
 Note: -a commits file. –am commit file along with
message
 “git remote –v” this shows the permission of
the files and origin of the file where we have to
fetch and push”.
GITHUB OVERVIEW 18
Push data/Code
 The below window is displayed in Git before
pushing data
 Enter the command “git push origin master”.
This command will push data to git
GITHUB OVERVIEW 19
Continued..
 Window will be displayed where it asks for user
name and password for first time login.
 User can connect to Github with SSH keys
which will automatically push code to main cod
 User has to enter their Github Username and
password. The below window is displayed after
pushing data to Git
GITHUB OVERVIEW 20
Continued…
 Now go to Github webpage and check if
the code/script file is added to the path.
GITHUB OVERVIEW 21
Basic command to display changes made
 Enter this command in command prompt
“git diff helloworld.py”. This will show the changes
made.
Note: User can provide file path in above
command where I have written file name as
“helloworld.py”
GITHUB OVERVIEW 22
Creating Branches
 User can create branches if they don’t want
to affect the changes in master code or if
“N” no of users are using same master
code. Here Master code will be unaffected
whereas the branches have multiple
different codes. Use below commands
 “git branch”
 “git checkout –b devtest”
Note: devtest is the branch name which I have
given.
GITHUB OVERVIEW 23
Continued…
 Find screenshot where branch is created.
GITHUB OVERVIEW 24
Push Data
 Below command is used to push data
“git push origin devtest”
GITHUB OVERVIEW 25
Continued…
 Open Github website and confirm if the
branch created is reflected.
GITHUB OVERVIEW 26
THANK YOU
For any queries please contact:
sangeethas1989@gmail.com
GITHUB OVERVIEW 27

Overview of github

  • 1.
    OVERVIEW OF GITHUB BySangeetha Subramani Software Specialist
  • 2.
    TABLE OF CONTENTS Introduction InstallGit and Create Profile in Github website Starting a Fresh Project Creating Repository Using Repository in Git Checking Repository created in local Adding File in Git Change Script File and Save Modified File in Local Push Data/Code Basic Command to display changes made Creating Branches GITHUB OVERVIEW 2
  • 3.
    Introduction  Git isa version control software application created by Linus Torvalds (the creator of Linux) with the collaboration of many other developers.  A version control application keeps track of all the changes that you do in the files of your project. Every time you make changes to files of a project, you can push those changes to a repository. Other developers can pull your changes from the repository and continue to work with the improvements that you added to the project files.  This document is useful for those who has zero knowledge on Git. You can have a look at basic git commands here in this document. GITHUB OVERVIEW 3
  • 4.
     Install Gitfrom http://gitforwindows.org/  Open command prompt and run “cmd”  Enter the command “git version”. User should be able to view the version of git installed GITHUB OVERVIEW 4 Install Git and Create Profile in Github website
  • 5.
    Creating Git Profile Create Git profile by login to the below website https://github.com/login  Your page will look like this. Click on “Your Profile” to check for your repository. We will see this screenshot once we create repository GITHUB OVERVIEW 5
  • 6.
    Fresh Project  Createproject folder in local PC and open this path in command prompt  Run “git init” in the command prompt  “.git” file is created locally. GITHUB OVERVIEW 6
  • 7.
    Continued..  The “.git”file consist of config and other files which are mentioned below in the attachment. GITHUB OVERVIEW 7
  • 8.
    Creating Repository  Loginto github webpage and click on “New” button to create New repository.  Provide Repository name eg “Basic_Program”  Description(Optional): Basics  Select Public radio button(Access to public). Selecting Public or Private radio button is user specific. User can select Private also. GITHUB OVERVIEW 8
  • 9.
    Continued..  Finally clickon “Create Repository” button. GITHUB OVERVIEW 9
  • 10.
    Continued…  URL iscreated based on our inputs while creating repository. once the repository is created, Copy the url.  Here I have shown my newly created url for https selection. GITHUB OVERVIEW 10
  • 11.
    Using Repository inGit  Once the url is copied, navigate to command prompt type git clone and paste url Eg: “ git clone https://github.com/sangeethas1989/Basic_Progr am.git” GITHUB OVERVIEW 11
  • 12.
    Checking the repositorycreated in local  Basic_Program file is created under specified path.  User can check by providing “git status” command in command prompt to know the status of what is happening. GITHUB OVERVIEW 12
  • 13.
    Checking the status I am just checking the current status here with the command “git status” . Attached screenshot for the status. GITHUB OVERVIEW 13
  • 14.
    Adding file inGit  I have added python code/script file under my folder “Basic_Program” locally as shown below. Use below command to move to github.  “git add helloworld.py” OR  You can specify file path of helloworld.py Eg “git add FiePathOfHelloworldFile” GITHUB OVERVIEW 14
  • 15.
    Continued…  NOTE: Use belowcommand if you have multiple file to be added. “git add .” I have attached screenshot of command prompt where you can view the details. GITHUB OVERVIEW 15
  • 16.
    Continued…  User cango to Git profile and check if the file is added or not. “Basic_Program is the file which has been added now. GITHUB OVERVIEW 16
  • 17.
    Change script File& save Modified file in local  User can modify the script file and can save file with the help of below command  “git commit –am “FirstCommit” GITHUB OVERVIEW 17
  • 18.
    Continued…  Note: -acommits file. –am commit file along with message  “git remote –v” this shows the permission of the files and origin of the file where we have to fetch and push”. GITHUB OVERVIEW 18
  • 19.
    Push data/Code  Thebelow window is displayed in Git before pushing data  Enter the command “git push origin master”. This command will push data to git GITHUB OVERVIEW 19
  • 20.
    Continued..  Window willbe displayed where it asks for user name and password for first time login.  User can connect to Github with SSH keys which will automatically push code to main cod  User has to enter their Github Username and password. The below window is displayed after pushing data to Git GITHUB OVERVIEW 20
  • 21.
    Continued…  Now goto Github webpage and check if the code/script file is added to the path. GITHUB OVERVIEW 21
  • 22.
    Basic command todisplay changes made  Enter this command in command prompt “git diff helloworld.py”. This will show the changes made. Note: User can provide file path in above command where I have written file name as “helloworld.py” GITHUB OVERVIEW 22
  • 23.
    Creating Branches  Usercan create branches if they don’t want to affect the changes in master code or if “N” no of users are using same master code. Here Master code will be unaffected whereas the branches have multiple different codes. Use below commands  “git branch”  “git checkout –b devtest” Note: devtest is the branch name which I have given. GITHUB OVERVIEW 23
  • 24.
    Continued…  Find screenshotwhere branch is created. GITHUB OVERVIEW 24
  • 25.
    Push Data  Belowcommand is used to push data “git push origin devtest” GITHUB OVERVIEW 25
  • 26.
    Continued…  Open Githubwebsite and confirm if the branch created is reflected. GITHUB OVERVIEW 26
  • 27.
    THANK YOU For anyqueries please contact: sangeethas1989@gmail.com GITHUB OVERVIEW 27