GitHub
GitHub
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).
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:
(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.
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