What is Git?
Git is a popular version control system. It was created by Linus Torvalds in 2005, and has been maintained by Junio Hamano since then.
Git is used for:
1) Tracking code changes
2) Tracking who made changes
3) Coding collaboration
GitHub is a proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project.
To run git on your system;
- Download git- https://git-scm.com/downloads
- Signup on Github-https://github.com/signup
- Get your account verified
This is the dashboard of Github
1) HOW TO SET IT UP
- To achieve this, on your windows search bar, type git and select Git Bash
click on 'open' to see this
From here, lets do a Git Configuration
That is the Username, email address as shown below
Type ls to know the directory you are currently,
To check for Documents, type cd Documents
To create a folder, make a directory with this command, 'mkdir git-lab' as shown below:
To be sure of this folder, go to file explorer, document to see if the folder is there,
Open it to be sure it's empty,
Go to git Bash to run a git in the folder created
type 'cd git-lab'
The first git command I'm about to run is 'git init'
There is a .git folder created now with some files in it;
This means that I have successfully initialized git in my local machine
Next is to create a file called 'touch readme.md'
Next is to create a file called 'nano readme.md'. It will take you to a fresh page, type 'THIS IS MY FIRST REPOSITORY', then 'control and x' then 'y' for yes
Click on enter to exit the page, this will be displayed
The next command I will run is the 'cat readme.md'
The next command I will run is the 'git status'
The next command I will run is the 'git add readme.md'
The next command I will run is the 'git status'
2) TO CREATE A COMMIT
The next command I will run is the 'git commit -m "Adding a readme file'
3) TO CREATE A REPOSITORY
Go to your browser, click on the + sign in your github page to create a new repository
Give a name to the repository
then click on 'create'
Scroll down to click on 'create'
The repository is created as shown below;
Copy the highlighted command
Run the copied command on a browser
4) TO CREATE A GIT-PUSH
The next command I will run is the 'git push -u origin master'
The page below will be displayed
Click on 'sign in with a browser' as shown
The page below will be displayed
Click on 'Authorize Git Ecosystem' The page below will be displayed
Insert your password and click on 'confirm'
Once your password is confirmed, 'Authentication succeeded will be displayed'
The following command will be displayed on your git bash
Top comments (1)
Great