-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.Git log.txt
More file actions
194 lines (114 loc) · 4.43 KB
/
Copy path10.Git log.txt
File metadata and controls
194 lines (114 loc) · 4.43 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
*****************************************************************Git Log********************************************************
---------------------------------------------------------------------------------------------------------------------------------
To remove the git repo :
$ rm -rf .git
-----------------------------------------------------------------------------------------------------------------------------------
For Listing all the commited changes in our current repo
$ git log -p
Author:one who created the files
Commit:one who commited the files
-----------------------------------------------------------------------------------------------------------------------------
To List the changes in previous 'n' number of commits ,give the number at last of the above command
$ git log -p -3
(For Listing changes in last 3 commits)
----------------------------------------------------------------------------------------------------------------------------------
For the statistics of all commits
$ git stat
----------------------------------------------------------------------------------------------------------------------------------
For getting all commits in one line
$ git --pretty=oneline
For getting all commits in short
$ git --pretty=short
-----------------------------------------------------------------------------------------------------------------------------------
For getting all commits as per the time
$ git log --since=2.days
$ git log --since=2.weeks
$ git log --since=2.months
$ git log --since=2.years
----------------------------------------------------------------------------------------------------------------------------------
We can get the commit information in different ways of format using the command:
$ git log --pretty=format:"%h -- %aN"
The above command gives the commits in the format %h(commit hash) -- %aN(author name)
------------------------------------------------------------------------------------------------------------------------------
Some of the place holder values and their symbols
Placeholders that expand to information extracted from the commit:
%H
commit hash
%h
abbreviated commit hash
%T
tree hash
%t
abbreviated tree hash
%P
parent hashes
%p
abbreviated parent hashes
%an
author name
%aN
author name (respecting .mailmap, see git-shortlog[1] or git-blame[1])
%ae
author email
%aE
author email (respecting .mailmap, see git-shortlog[1] or git-blame[1])
%al
author email local-part (the part before the @ sign)
%aL
author local-part (see %al) respecting .mailmap, see git-shortlog[1] or git-blame[1])
%ad
author date (format respects --date= option)
%aD
author date, RFC2822 style
%ar
author date, relative
%at
author date, UNIX timestamp
%ai
author date, ISO 8601-like format
%aI
author date, strict ISO 8601 format
%as
author date, short format (YYYY-MM-DD)
%ah
author date, human style (like the --date=human option of git-rev-list[1])
%cn
committer name
%cN
committer name (respecting .mailmap, see git-shortlog[1] or git-blame[1])
%ce
committer email
%cE
committer email (respecting .mailmap, see git-shortlog[1] or git-blame[1])
%cl
committer email local-part (the part before the @ sign)
%cL
committer local-part (see %cl) respecting .mailmap, see git-shortlog[1] or git-blame[1])
%cd
committer date (format respects --date= option)
%cD
committer date, RFC2822 style
%cr
committer date, relative
%ct
committer date, UNIX timestamp
%ci
committer date, ISO 8601-like format
%cI
committer date, strict ISO 8601 format
%cs
committer date, short format (YYYY-MM-DD)
%ch
committer date, human style (like the --date=human option of git-rev-list[1])
%d
ref names, like the --decorate option of git-log[1]
%D
ref names without the " (", ")" wrapping.
----------------------------------------------------------------------------------------------------------------------------------
For changing the previous command
$ git commit --amend
An editor opens showing the previous commit type 'i' to insert the message and press escape for coming out of insert mode.
Now to write and quit the previous command type ":wq"
-------------------------------------------------------------------------------------------------------------------------------------
**When we clone a file in pwd the downloaded folder is a git repository not the current pwd**
----------------------------------------------------------------------------------------------------------------------------------