Introduction to Version control using Git and Github
Introduction to Version control using Git and Github
A Repository is a central location in which data is stored and managed. Each Git
project is called a repository, or “repo” for short. A repo stores all the files and changes
made to your project. We can single out two major types of Git repositories:
- Local repository
- Remote repository
Why Do We Need Version Control Systems?
Git is a free, open-source distributed version control software that is used to track
changes in source code during software development.
Compared to other version control systems, Git is responsive, easy to use, and
inexpensive (free).
Git Hosting Services
Git hosting services are online platforms that allow multiple developers to work on
the same codebase from different locations by storing Git repositories in the cloud.
GitHub is a web-based hosting service for Git repositories. GitHub was launched as a
company in 2008 and acquired by Microsoft in 2018.
Nowadays GitHub is the largest online storage space of collaborative works that exists
in the world.
GitHub has become the go-to hosting platform for projects using Git.
Installation & Setup
Installation & Setup
1. Download Git
Windows: https://gitforwindows.org/
Linux: https://git-scm.com/download/linux
Mac: https://git-scm.com/download/mac
https://github.com
Installation & Setup
3. Configure GitHub Credentials
The global git username and email address are associated with commits on all
repositories on your system. Configure your local Git installation to use your GitHub
credentials by entering the following:
4. Once your github account is ready and you’ve configured your github
credentials. Then you can create a project (a folder containing a file) in your local
computer.
5. Next, create a repository on Github where you’d want to push your local project
to. It is advisable not to enable the readMeFile when creating your github repo.
6. Go to the directory of the local project you created earlier using your terminal
and run the following commands:
Installation & Setup
* Ensure you are in the directory of the project you want to push to your repo before you run
the following.
Then, setup your personal access token (if it’s your first time pushing to github)