Table of contents
Git is a VCS(Version control system) which in layman's language means it helps to control the updates in the version.
why do we use Git?
the three major reasons why we use Git are as follows:-
- It helps in collaboration.
- It helps in version control(tracking version & Controlling it)
- it keeps track of everything- who edited, when edited, what changes are made
you can refer to this video for more understanding
What is GitHub? GitHub is basically a service provider that provides the service that is Git. It has the largest community in the world. some alternatives of GitHub are:-
- GitLab
- Bitbucket
In GitHub folder is generally referred to as a repository.
how to create a new repository
Step1-> go home -- >click +button on left top -->click New Repository
Step2-> readme file - all the project feature(description)
Step3-> click create repository
Windows user have to install the GitBash in order to push repository from there computer
open git bash
git clone link(to paste use right-click on mouse)
(commands) 1) cd - change directory - help to change directory (cd desktop)
2) cd .. -comes one folder back (cd .. )
3) pwd - print working directory (pwd)
4) ls -list of files in pwd (ls)
5) touch index.js (make a new index.js file name anything you want) (touch filename1 filename2 so-on)
6) mkdir - used to make folder (mkdir folder1 folder2)
7) git add .
8) git commit -m 'rfvgdfs'
9) git push
10) clear(clear the terminal)
11) git config --global user.name "ABC"
12) git config --global user.email "abc@example.com"
13) git pull (GitHub to the system)
14) git branch (to know all the branches)
15) git branch name (to make a new branch)
16) git checkout branch_name (to move to the branch)
17) git push origin branch_name
18) git branch -m old_name new_name (rename branch) never change the name of the main branch.
19) git branch -d login_feature (delete branch)
20) git branch -D (force delete)
21) tab to complete file name
if you guys liked this content you can buy me a coffee this will help me to generate more content for all of you.