Git use
1) cd project foldername
2) foldername git init - to initiate git
3)git status-to know status
*git status -s (specify which files is modified )M shop/templates/shop/about.html -ye file staging area me modify hui he M shop/templates/shop/contact.html-ye file working area me modify hui he* MM shop/templates/shop/about.html-ye file staging area me but working directory me chnage hui he
M shop/templates/shop/contact.html-ye file working directory me chnage hui he
4)git add pr.fo.name- to stage project
5)(in git bash terminal)touch file-to create new file in project folder
6)git add -A - :to add multiple files in a sec. simultaniously
7)git commit -m "message"- to commit (iske baad kuch bhi change hua to aap retrieve kr logo checkout cmd se)
8)git checkout -f (to retrieve privious save data)
*git checkout master(to swith branch)
9)git log (to see all commits)
10)git log -p -n (where n is no of last logs which you want to see)
11)rm -rf .git (delete git control of your project or remove .git folder of your project)
*git rm --cached file ( to remove file from only staging area)
*git rm (puri file ko uda degi hard disk se)
12)git diff ( to see what chenges we made ,it compair working directry to staging area)
13)git diff --staged (to see what chenges we made ,it compair staging area to last commit)
14)git commit -a -m "message"(to skip stagging area and direct add and commit)
M shop/templates/shop/about.html -ye file staging area me modify hui he
M shop/templates/shop/contact.html-ye file working area me modify hui he
* MM shop/templates/shop/about.html-ye file staging area me but working directory me chnage hui he
M shop/templates/shop/contact.html-ye file working directory me chnage hui he
*to ignore some files which you dont want to set
1)first create file .gitignore
2)create another file and write in this file which extentions of file you want to ignore like
(*.log) it means .log extention vali file nhi jayegi
Comments
Post a Comment