Git/C3/Hosting-Git-Repositories/English

From Script | Spoken-Tutorial
Revision as of 11:11, 15 March 2016 by Priyacst (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title of script: Hosting Git Repositories

Author: Priya K

Keywords: Video tutorial, Git, GitHub, repository, creating repository, adding files, commits, releases, creating branches, creating tags


Visual cue
Narration
Slide 1:

Hosting Git Repositories

Welcome to the spoken tutorial on Hosting Git Repositories.
Slide 2:Learning Objectives


In this tutorial, we will learn about
  • Git repository hosting services
  • Creating a GitHub account
  • Creating a repository in GitHub and
  • Creating a tag in the repository


Slide 3:

System requirement


To record this tutorial, I am using
  • Ubuntu Linux 14.04 and
  • Firefox web browser

You can use any browser of your choice.

Slide 4:

Pre-requisites


For this tutorial, you will need a working Internet connection.
  • You should also have basic knowledge of Git commands.
  • If not, for relevant Git tutorials, please visit the link shown.


Slide 5:

Git repository hosting services


First let us learn about Git repository hosting services.


  • There are many web-based hosting services available such as Bitbucket, CloudForge and GitHub.
  • Here you can import your Git repositories free of cost.
  • They provide a centralized location to share your repository, so that many people can collaborate on a project easily.
  • They allow you to download and study other's projects free of cost.


Slide 6:

Why GitHub


Next we will see why to use GitHub.
  • GitHub has become the most popular website for housing Open Source Software.
  • In GitHub you can view, discuss and review changes with your team effectively.
  • The procedure used in GitHub, will be similar to other free Git hosting websites.
  • You can explore them yourself later.


<<PAUSE>>

Next we will learn how to create an account in GitHub.
Open web browser >> type www.github.com >> press Enter Open your web browser and go to www.github.com.
Point to homepage Here in the homepage, you have to give your details for registration.
Type priya-spoken as user name

priyaspoken@gmail.com as emailid

I will type, priya-spoken as user name and

priyaspoken@gmail.com as email id.


Please type your prefered user name and valid email id.

Type a password Then I will type my password.


You can give any password as per your choice.

Click on Sign up for GitHub button Now click on Sign up for GitHub button at the bottom right.
Highlight Step 2


Click on Free

Next in Step 2, we have to choose our plan.


I will choose Free plan as I want to use the free service.

Click on Finish sign up button Now click on Finish sign up button.
Next we will create a repository in GitHub.
Point to New repository button in right side box >> click on it You can see a button New repository in the right side box.


Click on it.

Point to the verification message


It shows a message “Please verify your email address”.


GitHub will send a verification mail to our registered email id.


So we have to open our email account and click on the email which is sent by GitHub.

Open the Gmail account I have already signed-in to my email id which is registered with GitHub.


Let me open it.

Point to the GitHub mail I have an email from GitHub.


Let me click on it.


The subject line says, “Please verify your email address”.


If the mail is not found in your Inbox, please check your Spam or Junk folders.

Click on Verify email address button Now, click on Verify email address button.
On GitHub verification page We are redirected to the GitHub Homepage.


This indicates that we have successfully created our account in GitHub.


<<PAUSE>>

We will try to create a repository in GitHub.
Click on New repository button Now click on New repository button in the right side box.


You can see that now we are able to create repository.

Type stories in Repository Name Let us type “stories” as Repository Name.
Point to Description field If you want to give any description about the repository, we can do so here.
Click on Public option Next, I will choose Public option, which is free of cost.
Click on Private option and show the payment details.


If we choose Private option, we have to pay some fees to keep our repository private.


This means that other users cannot find and download our repository.

Again click on Public Let me click on Public again.
Click on Initialize this repository with a README box.


Click on this checkbox, Initialize this repository with a README.


This will create a readme file.


In this file, you can write information about the usage of code or installation instructions.


It will be useful for all the collaborators.

Point to the message “Skip this step if you’re importing an existing repository” However, if we are importing an existing repository, this box should be unchecked.
Now click on Create repository button Now click on Create repository button.
Highlight User name and repository name You can see the repository name along with your user name has been created successfully.


<<PAUSE>>

Point to README.md file


Highlight on README.md file

Point the readme writer area

Once the repository is created, you can see the readme file label at the left bottom.


We will write some information in this file later.

Point to commit, branch and contributor By default, we can see a commit (i.e) Initial commit, one branch (i.e) master branch and one contributor.


You can click on each link and explore them at your convenience.

Now, let us start working in this repository.
Click on New file button We will begin by adding a file to our repository.


Click on New file button in the middle panel.

Type kids-story.html A new form opens up for creating a file.


Here I will give the file name as kids-story.html.

Copy and paste the code into the file I will copy and paste some code into this file, from my Writer document, which I had saved earlier.


Likewise, you can add some content into your file.

Let's commit this new file now.
Scroll down the page Scroll down the page to give the commit message.
Point to the commit message field Here in the commit message field, you can see the default message Create kids-story.html.
You can keep the default message or type a new message.


I will keep the default message.

In the extended description, type Added first file of the repository Here in the next field, you can also give an extended description of the commit.


So here, I will type: Added first file of the repository.

Point to master branch By default, we commit to the master branch.
Click on Commit new file button Now click on Commit new file button.
Point to kids-story.html Our new file kids-story.html is added to the repository.


<<PAUSE>>

Point to 2 commits Notice that now the commit number is increased to two.
Click on 2 commits Let’s click on it.
Point to the three dots Here you can see three dots next to the commit message.
Click on the three dots Let me click on it.
Point to the description It shows the description of the commit.
Click on Create kids-story.html


To know what we have done in the commit, click on that particular commit message.
Point to the details Now you can see the details of the commit.
Go back Let’s go back to the commit list.


For this click on the left arrow button at the top left corner of the browser.

Point to hash value On the right side, you can see the hash value of the commit.
Click on Code tab Click on Code tab at the top left corner to come back to the repository.


<<PAUSE>>

Next let me demonstrate how to create a new branch in GitHub.
Click on Branch drop down. In the left side, you can see a dropdown list labeled Branch.


Click on it to create a new branch.

Point to Find or create a branch field. You can see a pop-up window opens up.


In the pop-up window, you can see Find or create a branch field.

Type new-chapter in branch name field I will type new-chapter as the new branch name and press Enter.
Point to Branch: new-chapter You can see that the new-chapter branch is created and it is our current branch.


<<PAUSE>>

Next, we will make a commit in the new-chapter branch to understand the branching process better.


Let’s make some changes in kids-story.html file for demonstration purpose.

Click on kids-story.html file In the repository, click on kids-story.html file to open it.
Point to edit icon >> click on it At the top right corner of the editor panel, you can see an edit icon.


Click on it to edit this file.

Copy and paste the lines I will add some lines here which I have copied from my Writer document.


You can do so likewise.

Point to commit message Now, we will commit this change.


I will keep the default commit message as it is.

Point to new-chapter branch


Here you can see the branch name new-chapter where this commit was made.
Click on Commit changes button To commit, click on Commit changes button.
Click on Code tab Let’s click on Code tab to go back to our repository.
Next let’s checks the commits of master and new-chapter branches.
Click on commits link Click on commits link.
Point to Branch dropdown Here in the Branch drop down, we can select the branch name that we want to see.
Select master branch


Point to the commits

I will select master branch in the list.


Once it is selected, the commits of the master branch will be listed.

Select new-chapter branch


Point to the commits

To see the commits of new-chapter branch, we will select new-chapter in the Branch drop down.


Now you can see the commits of new-chapter branch.


<<PAUSE>>

Click on Code tab Let’s click on Code tab to go back to our repository.
Next let us see how to create a tag in GitHub.


We already know that tagging is used to mark a commit stage as important.

Click on releases link For example say, I want to create a tag in the master branch after adding kids-story.html file.


To create a tag, first click on releases link.

Click on Create a new release button Click on Create a new release button.
In the Tag Version box, type V1.0. A new form opens up.


In the Tag Version box, type V1.0.

In the Release title box, type Version one. In the Release title box, type Version one.
Point to Write tab

Type “This is the version one

In the Write box we can give the description of our tag.


I will type “This is the version one”.

Click on Publish release button Now click on Publish release button.
Point to hash value Here on the left side, you can see the hash value of the latest commit.


We already know that by default, the tag will be created in the latest commit.


<<PAUSE>>

With this, we come to the end of this tutorial.
Slide 7:

Summary


Let us summarize.


In this tutorial, we have learnt about

  • Importance of online Git hosting services
  • Creating a GitHub account
  • Creating a repository in GitHub and
  • Creating a tag in the repository


Slide 8:

Assignment


As an assignment
  • Create a repository in GitHub
  • Add few files to the repository
  • Edit the files and do some commits and
  • Try to create branches and tags in the repository


Slide 9:

Acknowledgement


The video at the following link summarises the Spoken Tutorial project.


Please download and watch it.

Slide 10:

Spoken Tutorial Workshops


The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass online tests.


For more details, please write to us.

Slide 11:

Acknowledgement


Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.


More information on this Mission is available at the following link.

This is Priya from IIT Bombay signing off. Thanks for joining.

Contributors and Content Editors

Priyacst