Skip to content

joyontokumar/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Setup

git config --global user.name "joyonto"

git config --global user.email "engr.joyontoroy@gmail.com"

Git Helping Command

git help

git help config

(open a new window and all git information here)

Git Initalization

Create a project directory and initialize git.(open this directory any command promot) and type

git init

Local to Server

git add . ( this command use to add all of files to your local git repository)

git add index.html (if you want to add a fixed file to your local repository)

git add -A ( Another command add all of files to your local git repository)

git commit -m "message here what you add" ( this command use what you do or what you add your local git repository)

gi remote add origin ( github repository link here) => that means your local repositoy added your server repository

git push origin master (my local file go to the server

Git Clone

If you want to add a github project to your local repository then you need to write :

git clone (github repository link)

When clone your github repository to your local server . then you can put this clone repository to another github repository see bellow the command :

git remote set-url origin (your another github respository url)

git push origin master ( push all local file to server)

Git Branch

master is the default branch in github . branch is actually all of my commit but those commit has a unique name. if you want to go this commit you want to checkout . if you want to create a branch just try to expriment a logic is right or wrong. if my expreiment is true then i push the expriment my master branch . that why another branch is uses.
if you want to create a branch. then type this commnd :

git branch develop(then type branch name -> here is the branch name -> develop)

if you want to go the develop branch then type :

git checkout develop

If you want to create branch and checkout branch in one command then type :

git checkout -b develop

Develop Branch Work to Master Branch Passing

when i work on develop branch and try to do something my expriment .suppose my expriment is right and i want to pass this expriment my master branch then type the command :

git checkout master

when you type this command noting happend . because you only jump develop to master. but you can to passing develop branch expriment to master branch. so if you want to passing this then type :

git merge develop

then you can see develop branch expriment pass the master branch

If you want to see all commit in master branch and develop branch then type

git log --oneline

If you want to delete any branch

git branch -D develop (here develop is the branch name)

Git Pull

when many developer are working in one project then need to git pull command . when any developer are pushing his work in server, it's not automatically go to another local developer repository. what why we need to git pull.

git pull origin master

Be carefull when you pull before you need to add , commit your work

Git Important Command

git log ( if you want to check your commit)

git log --oneline (if you want to check your commit in nicelly )

git checkout 567567 (if you want to go a fixed commit ) (567567 => this is the unique commit number)

be carefull : when you go to fixed commit then you can not see after those commit . those commit are delete

git status ( tracked and untracked file)

git rm index.html (delete file in working directory)

git tag (show all commit id)

git remote (conenct local to server)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors