forked from Sonal0409/DevOps_ClassNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInClassNotes09March
More file actions
108 lines (53 loc) · 1.63 KB
/
InClassNotes09March
File metadata and controls
108 lines (53 loc) · 1.63 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Scenario 1:
git log --oneline
git log --oneline >> filename.txt
git show commitid
Scenario 2:
Take an exisitng file, make change to it. Add the chnages/modification to git
made chnages to file index1.html
git add filename
git commit -m "done"
OR
exiting file is modified
take an exisitng file..make chnages to it
git status
git commit -a -m " added modification"
Scenario 3:
pre req : file should be already exisitng
take a file which is in LR
git ls-files
vim filename ==> add chnages
git status ===> modification
to see the difference of chnages done on a file
git diff filename
to see the difference of chnages done on 2 commits
git diff commitid1 commitd2
********************
Scenario 4:
Delete an exisitng file from Local Repo as well from Working Directory
git rm filename
git commit -m "deletion"
delete file only from local repo
git rm --cached filename
********************
Scenario 5: Revert the changes
$ git revert commitid
*****************
Scenario 6:
Set up the configuration of git repo
$ git config --global user.email mailid
$ git config --global user.name yourName
**********************
Scenario 7 : repeat it for Ramesh
*******
if there are files that you do not want git to track
Create a file .gitignore
add the name of the files that are not required to be tracked by git
save the file
$ git status
$ git add .
$ git commit -m "done"
Scenario is applicable for files that are untacked by git
rm -rf ==> linux command==> delets file from working directory
git rm ==> git command ==> deletes file from WD & local repo
git rm --cached ==> git command ==> deletes file from only local repo