-
Notifications
You must be signed in to change notification settings - Fork 0
/
git command.txt
57 lines (26 loc) · 3.43 KB
/
git command.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
dir //directory check krne k liye k kitni file hai as directory mai.
git init // as ka mtlb h k hmre as folder mai git k repositery create ho gye h.
git status // ye command bar bar use ho gey jb b changing ae gey to as command se check kren gy.
(git mai master branch hmesha majod hti hai)
git add . // file ko git mai add krne k liye. git k repositery ka hisa bn jyn gey.
git commit -m //git mai changes ka pta lgne k liye k kia kia changes hoe hai(git commit -m "add file git command.txt").
git log // git log branch btata h kis branch mai ap k file work kr ri hai.
commit hash // jb bht se log ak he file pe km kr rhe hn to hr ksi ka alg alg hash number hta h jis se pta chlta h k ye line ya ye changing kis ne k hai.
git reset // jb koi file stage k ho or ap chte hai k file unstage ho jae ye tb ho ga jb ye commit ni hoe hn gey.maslan 4 file ap ne stage kr dn hai jb k krni 2 file thn.(git add .) se file stage hti hai yhi pe agr git reset kren gy to ye unstage ho jyn gey.
git reset --hard // sirf ye unstage ni kre ga balke git k file mai jo changing k then wo remove hn gey (syage file ho ya an ho ye file k andr k change ko remove kr deta h).
.gitignore // kis file ko hm ne git ka hisa na bnana ho us k liye (.gitignore) k file bna k us mai us file ka name pora enter kren gy or agr hm chte hai k (.txt) wali koi b file hisa na bne ya (.exel) k koi file hisa na bne to (*.txt) as se .txt k sari file ignore hn gey.(echo ""> .gitignore).jha ignore k file bnani ho git mai ja ye command likne se bn jae gey.
git branch // se branches ka list pta chlti h k kitni branch hai.
git branch -v//as se last commit ka pta chlta h kb hwa tha.
git branch(name)// git mai master k elwa brach bnani ho to ase bne gey(git branch dev) dev branch ka name h
git checkout dev// as se hm master branch se dev branch mai shift ho gye mtlb branch shift k liye.
git log master..dev// as se dekha jta h k kia kia changes ae hai.as mai pta chle ga master k mukable mai dev mai ye ye aditional commit hai.
git merge dev // as se dono branch k file marge ho jyn gey master k file dev mai or dev k file master mai show hn gey likn master k changes dev mai show ni hn gy.
git commit -m "update (filename).txt// as se file mai ko changes k hai update ho jyn gey.
git merge master // maslan dev mai changes k hai to as command se dev mai khre ho k master k changes ko merge kren gy.
git stash // koi km kr rhe hai or ksi wja se kam adhora kam chor k ksi or branch mai kam krne lg jte hai to us adhore kam ko commit kiye bger wahi pe rok k stash kren gy or jb mrzi whi se dubra strt kr dn gy.
cd .. // as command se ak folder back ayn gy maslan agr ap D:git:Command mai hai to cd .. se ap D:git mai ajyn gy.
cd (folder name) // as se hm ne jis folder mai jna ho us cd name likh k ja skte hai.
git clone URL // git hub pe phle new repositery bnyen gy us ka URL copy kr k jis jgha folder bnana h waha cmd open kren y or (git clone URL) paste kren gy to khud he ak folder bn jae ga.
git push // git hub mai clone krne k bd as command se push krne se file git hub mai push ho gey or jo kuch b likha ho ga file mai wo b show ho ga.
git fetch //github pe jo file h us mai changes hoe hai to as command se fetch kren gy likn wo changes local system pe nzr ni ayn gy us k liye git merge krna pre ga phr nzr ayn gy.
git pull // jse k as line ko githab mai edit kr k likha h to ye changes yhi hn gy in ko system k file mai add krne k liye git pull k command use ho gey phr ye changes us file mai add hn gy.