alt sam

By Samkb420 And Dsc Laikipia University Club. Happy learnig this is for Dsc Laikipia club,To help build and learn programing together.Its not limited to ather learners welcome and lets learn together.

Intoduction to Git && Github

Version Control System(VCS) for tracking changes in computer files

Basic commands

Git is distributed version Control System that is available for Mac,windows and Linux.

Installation

On Mac

Open browser an type the following.
Go to https://git-scm.com/download/mac

On Linux(Desbian)

open terminal and type the following

$sudo apt-get install git

On Linux(Fedora)

open terminal and type the following

$sudo yum install git

On windows

Go to https://git-scm.com/win

Getting started

Open terminal and lets check the version

Usage on terminal

locolhost@samkb420-$ git --version
git version 2.21.0.windows.1

All ready let now start using git

Initialize Local Git Respository

locolhost@samkb420-$git init
Initialized empty Git repository in C:/Users/Samkb420/git/.git/

Configuring git on Your machine

locolhost@samkb420-$git config --global user.name 'samkb420'
locolhost@samkb420-$git config --global user.email 'kagosamuel01@yahoo.com'

Adding file(s) to index

locolhost@samkb420-& git commit -m "added index.html"
[master (root-commit) 7ff22da] added index.html
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 index.html

Pushing To a Remote Repository

This is to send code or work to remote area or servers ie Github,Heroku or Google Cloud.
For example lets say that We are developers and working on a web app that contains frontend and backend and lets say kelvinHalx works with frontend where he uses bootstrap4 and html for design and kelyn works with backend with python Flask framework And lets say sam is The project lead.They will push there code and sam will merge changes on the files and by the end of the day it will be a complete function web deployed and running.

locolhost@samkb420-& git push -u origin master

Pull from A Remote Repository

This is to pull the latest from Remote Repository

locolhost@samkb420-& git pull https://github.com/samkb420/Hellow-world.git

Cloning A Repository

locolhost@samkb420-& git clone https://github.com/samkb420/Hellow-world.git
By Dsc laikipia University Club

Contribution

Contibute By creating an account on Github

Github Twitter Facebook Linkedin Telegram