Skip to content

ashmit-codebase/Git-Commands-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 

Repository files navigation

GIT

It is a version control system and a tool that helps to track changes in the code.
It is popular because :-
1- It is free and open source
2- It is fast and scalable

Functions :-
1- It tracks the history
2- It collaborate with the changes

GITHUB

It is a website or an app that allows developers to store and manage their code and project using git.

GIT COMMANDS

A collection of useful Git commands with explanations

Setup and Configuration

1 : git config --global user.name "YOUR NAME" => TO SET USERNAME
2 : git config --global user.email "YOUR EMAIL" => TO SET EMAIL ID
3 : git config --list

Starting Repo

1 : git init => TO INITIALIZE NEW REPO
2 : git clone <-COPY LINK-> => CLONING REPO

Logs

1 : git status => DISPLAY STATE OF THE CODE
2 : git log => TO CHECK HISTORY
3 : git diff => TO SEE CHANGES
4 : git merge <-BRANCH NAME-> (MERGING BRANCHES)
5 : git fetch

Initing

1 : git remote add origin <- LINK->
2 : git remote -v

Adding, Commiting & Pushing

1 : git add . => EDITING CODE
2 : git add <-file name-> => EDITING CODE
3 : git commit -m "MESSAGE" => COMMITING CHANGES
4 : git push origin main => PUSHING CODE
5 ; git push => PUSHING CODE

Branch Commands

1 : git branch => CHECK BRANCH
2 : git branch -M main => RENAME BRANCH
3 : git checkout <-BRANCH NAME-> => NAVIGATE TO OTHER BRANCH
4 : git checkout -b <-NEW BRANCH NAME-> => CREATE NEW BRANCH
5 : git branch -d <-BRANCH NAMED> => DELETE BRANCH

Full Forms

1 : cd = CHANGE DIRECTORY
2 : ls = LIST FILES
3 : ls -a = HIDDEN FILES
4 ; mkdir = MAKE NEW DIRECTORY

WORKFLOW

Github Repo -> Clone -> Change -> Add -> Commit -> Push

IT IS THE BASICS OF GITHUB IN WHICH WE HAVE LEARN ABOUT GIT AND GITHUB AND THEN THEIR COMMANDS AND SOME SMALL TERMS.

About

A collection of useful Git commands with explanations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors