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

GitHub

The document explains Git as a Version Control System that helps programmers track changes in their code, allowing them to save and revert to previous versions. It introduces GitHub as a platform for hosting Git repositories, facilitating collaboration among developers and serving as a portfolio for potential employers. Additionally, it outlines the basic functionalities of Git and GitHub, including creating repositories, committing changes, and using command prompts for various tasks.

Uploaded by

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

GitHub

The document explains Git as a Version Control System that helps programmers track changes in their code, allowing them to save and revert to previous versions. It introduces GitHub as a platform for hosting Git repositories, facilitating collaboration among developers and serving as a portfolio for potential employers. Additionally, it outlines the basic functionalities of Git and GitHub, including creating repositories, committing changes, and using command prompts for various tasks.

Uploaded by

maryam tqq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ICT ASSIGNMENT

Before jumping into GitHub, we must first be familiar with the term ‘Git’
So, what exactly is Git?

GIT
Git in layman term is basically a Version Control System tool, which helps track change
in code think of it like a ‘Save game’ feature in your games.
Every time you make an important change in your code, you save that change via Git,
it is a useful tool for modern day programmers and developers that enables them to
stay organized. Not only that, but you can save the new altered version of your
program and even go back to you previous version as well.
Git was first created in 2005 by Linus Torvalds (The creator of Linux)
In short Git is,

Version
Control
System

Git
Collaboration Open source
tool software

What is GitHub?
Github one of many sites (the most common one) that host Git repositories.
It ( https://github.com) is a website where developers can store, organize, and share
their code with others. It helps keep all your coding projects in one place, and these
projects are saved in something called "Repositories."
A repository is like a folder where all the files for a specific project are kept, making it
easy for you and other developers to work together on the same code.
Many developers include a link to their GitHub profile when applying
for jobs so potential employers can view their work. This allows employers to explore
the developer's projects, review the quality of their code, and verify their technical skills
It serves as a portfolio where employers can assess not only the projects they've
worked on but also their coding style, problem-solving abilities, and participation in
open-source communities.

Why is it used?
The most common and widely used reason is Version Control Tracking.
For example: Imagine you write an app, it is working perfectly. Then the next day you
add a feature and now nothing works, you have no idea what gone wrong. If you don't
have any version control, you’ll mess up If you have one, you simply roll back to
yesterday's "commit".
*COMMIT: The snapshot of change you make in your code.

Not only that, but GitHub also provides Automated Testing it integrates with tools that
automatically check if your code works properly whenever new changes are made.

Additionally, and for what I, as a beginner use it, is for Learning Resource. It’s a great
place to learn by exploring other developers projects and code.

Many tech companies use it as a Collaboration Tool for big projects too, because it
allows teams to work on the same project, leave comments, suggest changes, and
resolve issues together. Because in big tech companies there are many developers
who work on the same project as we want to make sure the work is not being override
and everyone is on the same page.
How does it work?
After setting up your profile on GitHub, the next step is to create a repository (although
it could be anything but usually it is a ‘readme’ file)
A repository is like a project folder that contains all the files, code, and documents
related to that specific project.

To create a repository, click the “+” icon on the top right of the GitHub page and select
“New repository.”
Name your repository and choose if you want it to be public (anyone can see it) or
private (only you or people you invite can view it).

Here I have already signed up and on the top right side of


the page I’ve to click on ‘New Repository’ in order to make a repo file.
Once your repository is created, you can start adding your project files.
You can either upload code directly on the GitHub website or use Git commands
on your computer using command prompt or Git bash to push your files to the
repository (Both methods are valid, but I personally prefer former one.
(Visual example of an uploaded code file in a repo)

Role of Command Prompt:


the Command Prompt is a tool used to interact with your computer through text-based
commands instead of a graphical interface
For Beginners: GUI is often more convenient for those just starting out, as it’s easier
to understand and use.
For Advanced Users: CLI is preferred by many experienced users for its speed,
efficiency, and control, especially for tasks like version control with Git and GitHub.
There are some key uses of using command prompt:

1.Cloning repos :
Download a copy of a GitHub repository to your local machine. If a repo is public you
can copy it to your local machine (your device = local machine) using cmd command =
git clone <repo url here>

2.Comitting Changes:
What is commit?
A commit in Git is essentially a snapshot of your project's current state at a specific
point in time. It represents a set of changes that you have made to the files in your
repository. (as mentioned earlier)
By using command prompt or Git bash we can type:

git commit -m "Your commit message"

git: This is the command that invokes Git.


commit: This command tells Git that you want to save your changes.
-m: This flag stands for "message" and is used to provide a short description of what
changes were made in this commit.
"Your commit message": When creating a commit, you provide a message that
describes the changes made. This message helps you and others understand the
purpose of the commit (change).

3.Pushing / pull changes:


Pushing changes means sending your committed changes from your local system
to a remote repository on GitHub.
Local = your device
Remote = GitHub
Command for pushing repo:
git push origin main

(The easiest method I find is it write these commands on VS code terminal, which is
an IDE)

Pulling means getting the latest updates from a remote repository (like GitHub) and
merging them into your local copy.

Command for pulling changes is:


git pull origin <branch-name>

4. Creating branch:
Another useful and widely used function of command prompt is to create branches
When you create a branch, you’re making a copy of the project’s current state. You
can make changes in this branch without impacting the main branch (usually called
main or master).
Creating a branch allows you to work on new features or fixes without affecting the
main codebase.
Command for creating branch is
git branch <new-branch-name>

You can safely collaborate and explore through branch command feature
You can check out my mini GitHub project here.

Conclusion:
In conclusion, this GitHub project shows how teamwork and version control help
manage complex software development. By using GitHub's tools, we improved our
development process and built a community of contributors

You might also like