0% found this document useful (0 votes)
70 views7 pages

GitHub Account Setup & C++ Program Save

The document provides step-by-step instructions for creating a GitHub account and repository and performing basic operations like creating branches and commits. It explains what GitHub is, how it differs from Git, and how to get started with creating an account, repository, branches, and commits.

Uploaded by

pinali patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views7 pages

GitHub Account Setup & C++ Program Save

The document provides step-by-step instructions for creating a GitHub account and repository and performing basic operations like creating branches and commits. It explains what GitHub is, how it differs from Git, and how to get started with creating an account, repository, branches, and commits.

Uploaded by

pinali patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

PRACTICAL:-1

AIM:-Create your account on Github and save a simple c++ program in


Github. Explore the functionalities of Github.

What is Github?
The basic functions of Github are as follows:-

Github is a Git repository hosting service, but it adds many of its own features. While Git is a
command line tool, Github provides a Web-based graphical interface. It also provides access
control and several collaboration features, such as a wikis and basic task management tools for
every project.

Git and GitHub


A quick aside: git and GitHub are not the same thing. Git is an open-source, version control tool
created in 2005 by developers working on the Linux operating system; GitHub is a company
founded in 2008 that makes tools which integrate with git. You do not need GitHub to use git,
but you cannot use GitHub without using git. There are many other alternatives to GitHub, such
as GitLab, BitBucket, and “host-your-own” solutions such as gogs and gittea. All of these are
referred to in git-speak as “remotes”, and all are completely optional. You do not need to use a
remote to use git,but it will make sharing your code with others easier.

Functionality Of GitHub
GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a
command line tool, GitHub provides a Web-based graphical interface. It also provides access
control and several collaboration features, such as a wikis and basic task management tools for
every project.

How To Start the GitHub


New to git? Follow the steps below to get comfortable making changes to the code base, opening
up a pull request(PR),and merging code into primary branch. Any important git and GitHub
terms are in bold with links to the official git reference materials.

More About GitHub


To be very crisp about what exactly is GitHub, It is a file or code-sharing service to collaborate
with different people.

GitHub is a highly used software that is typically used for version control.It is helpful when more
than just one person is working on a project. Say for example, a software developer team wants
to build a website and everyone has to update their codes simultaneously while working on the
project. In this case, GitHub helps them to build a centralized repository where everyone can
upload, edit, and manage the code files.

Why is GitHub So Popular?


GitHub has various advantages but many people often have a doubt as to why not use dropbox or
any cloud based system? Let me take the same example forward to answer this question. Say
more than two software developers are working on the same file and they want to update it
simultaneously. Unfortunately, the person who save the file first will get precedence over the
others. While in GitHub, this is not the case. GitHub document the changes and reflect them in
an organized manner to avoid any change between any of the files uploaded.

Therefore using GitHub centralized repository, it avoids all the confusion and working on the
same code becomes very easy.

If you look at the image GitHub is a central repository and Git is a tool which allows you to
create a local repository. Now people usually get confused between git and GitHub but its
actually very different.Git is a version control tool that will allows you to perform all kinds of
operations to fetch data from the central server or push data to it whereas GitHub is a core
hosting platform for version control collaboration.GitHub ia a company that allows you to host a
central repository in a remote server.

Now, let me list down the ways in which GitHub makes git simple:

 GitHub provides you a beautiful visual interface which helps you to track or manage your
version controlled projects locally.
 Once you register on GitHub, you can connect with social network and build a strong
profile.
So let’s get started with GitHub
A repository is a storage space where your project lives.It can be local to a folder on your
computer, or it can be a storage space on GitHub or another online host. You can keep code files,
text files, images or any kind of a file in a repository. You need a GitHub repository when you
have done some changes and are ready to be uploaded. This GitHub repository acts as your
remote repository. So let me make your task easy, just follow these simple steps to create a
GitHub repository:

 Go to the link: https://github.com/ Fill the sign up form and click on “Sign up for
Github”.
 Click on “Start a new project”.

Refer to the below screenshot to get a better understanding.

 Enter any repository name and click on “Create Repository”. You can also give a
description to your repository(optional).
Create Branches and Perform operations

Branching: Branches help you to work on different versions of a repository at one time.
Lets say you want to add a new feature(which is in the development phase), and you are
afraid at the same time whether to make changes to your main project or not. this is where git
branching comes to rescue. Branches allow you to move back and forth between the different
states/versions of a project. In the above scenario, you can create a new branch and test the
new feature without affecting the main branch. Once you are done with it, you can merge the
changes from new branch to the main branch. Here the main branch is the master branch,
which is there in your repository by default. Refer to the below image for better
understanding.

As depicted in the above image, there is a master/production branch which has a new branch
for testing. Under this branch, two set of changes are done and once it completed, it is
merged back to the master branch. So this is how branching works!Lets move ahead in ‘how
to use GitHub’ blog, and learn how you can create a branch.
To create a branch in GitHub, follow the below steps:

 Click on the dropdown “Branch:master”


 As soon as you click on the branch, you can find an existing branch or you can create
a new one. In my case.I am creating a new branch with a new branch with a name
“main”. Refer to the below screenshot for better understanding.

Once you have created a new branch, you have two branches in your repository now i.e.
main(master branch)and main.The new branch is just the copy of master branch.So let’s perform
some changes in our new branch and make it look different from the master branch.

How to use GitHub: Operations

Commit Command
This operation helps you to save the changes in your file.when you commit a file, you should
always provide the message, just to keep in the mind the changes done by you.Though this
message is not compulsory but it is always recommended so that it can differentiate the various
versions or commits you have done so far to your repository. These commit messages maintain
the history of changes which in turn help other contributors to understand the file better. Now
let’s make our first commit.
We have successfully made our first commit.

Step:-1

Go to https://github.com/join in a web browser. You can use any web browser


on your computer,phone, or tablet to join.

 Some ad blockers,including uBlock Origin, prevent Github’s verification


CAPTCHA puzzle from appearing, For best results, disable your web
browser’s ad blocker when signing up for GitHub.

Step:-2

Enter your personal details. In addition to creating a username and entering an


email address,you’ll also have to create a password. Your password must be at
least 15 characters in length or at least 8 characters with at least one number and
lowercase letter.

 Carefully review the Terms of service at


https://help.github.com/en/articles/github-terms-of-service and the Privacy
statement at https://help.github.com/en/articles/github-privacy-statement
before you continue. Continuing past the next step confirms that you agree
to both documents.

You might also like