-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.html
More file actions
256 lines (231 loc) · 6.45 KB
/
notes.html
File metadata and controls
256 lines (231 loc) · 6.45 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>All About Pull Requests in Git</title>
<style>
/* General Styles */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f9f9f9;
color: #333;
}
h1,
h2,
h3 {
color: #2c3e50;
}
h1 {
text-align: center;
margin-top: 20px;
font-size: 2.5em;
}
h2 {
margin-top: 30px;
font-size: 1.8em;
border-bottom: 2px solid #3498db;
padding-bottom: 5px;
}
section {
background: #fff;
margin: 20px auto;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
max-width: 800px;
}
p,
li {
font-size: 1.1em;
color: #555;
}
ul,
ol {
padding-left: 20px;
}
li {
margin-bottom: 10px;
}
code {
background-color: #e9ecef;
padding: 2px 6px;
border-radius: 4px;
font-family: 'Courier New', Courier, monospace;
font-size: 0.9em;
color: #d40f72;
}
pre {
background-color: #2c3e50;
color: #ecf0f1;
padding: 15px;
border-radius: 6px;
overflow-x: auto;
}
pre code {
background-color: transparent;
color: inherit;
padding: 0;
}
footer {
text-align: center;
margin: 40px 0;
font-size: 0.9em;
color: #777;
}
footer a {
color: #3498db;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
/* Responsive Design */
@media (max-width: 768px) {
h1 {
font-size: 2em;
}
h2 {
font-size: 1.5em;
}
section {
margin: 10px;
padding: 15px;
}
}
</style>
</head>
<body>
<h1>All About Pull Requests in Git</h1>
<section>
<h2>What is a Pull Request?</h2>
<p>
A <strong>Pull Request (PR)</strong> is a feature in Git platforms (like
GitHub, GitLab, or Bitbucket) that allows developers to propose changes
to a repository. It enables collaboration by requesting the maintainers
to review and merge the changes into the main branch.
</p>
</section>
<section>
<h2>Why Use Pull Requests?</h2>
<ul>
<li>Encourages code review and collaboration.</li>
<li>Ensures changes are tested and validated before merging.</li>
<li>Provides a clear history of changes and discussions.</li>
</ul>
</section>
<section>
<h2>Steps to Create a Pull Request</h2>
<ol>
<li>
<strong>Fork the Repository:</strong> Create a copy of the repository
on your GitHub/GitLab account.
</li>
<li>
<strong>Clone the Repository:</strong> Use
<code>git clone <repository-url></code> to clone the forked
repository to your local machine.
</li>
<li>
<strong>Create a New Branch:</strong> Use
<code>git checkout -b <branch-name></code> to create a new
branch for your changes.
</li>
<li>
<strong>Make Changes:</strong> Add, edit, or delete files as needed.
</li>
<li>
<strong>Commit Changes:</strong> Use <code>git add .</code> and
<code>git commit -m "Your commit message"</code> to commit your
changes.
</li>
<li>
<strong>Push Changes:</strong> Use
<code>git push origin <branch-name></code> to push your branch
to the remote repository.
</li>
<li>
<strong>Open a Pull Request:</strong> Go to the repository on
GitHub/GitLab and click "New Pull Request." Select your branch and
provide a title and description for the PR.
</li>
</ol>
</section>
<section>
<h2>Best Practices for Pull Requests</h2>
<ul>
<li>Write a clear and descriptive title for the PR.</li>
<li>
Provide a detailed description of the changes, including the purpose
and any related issues.
</li>
<li>Keep PRs small and focused on a single task or feature.</li>
<li>
Reference related issues or tickets using keywords like
<code>Fixes #123</code>.
</li>
<li>
Ensure your code is tested and follows the project's coding standards.
</li>
</ul>
</section>
<section>
<h2>Reviewing a Pull Request</h2>
<p>As a reviewer, you should:</p>
<ul>
<li>
Check the code for correctness, readability, and adherence to
standards.
</li>
<li>Test the changes locally if necessary.</li>
<li>Provide constructive feedback and suggestions for improvement.</li>
<li>Approve the PR if it meets the requirements.</li>
</ul>
</section>
<section>
<h2>Merging a Pull Request</h2>
<p>
Once a PR is approved, it can be merged into the main branch. Options
include:
</p>
<ul>
<li>
<strong>Merge Commit:</strong> Combines the changes into a single
commit.
</li>
<li>
<strong>Squash and Merge:</strong> Combines all commits into one
before merging.
</li>
<li>
<strong>Rebase and Merge:</strong> Replays the commits on top of the
main branch.
</li>
</ul>
</section>
<section>
<h2>Closing a Pull Request</h2>
<p>
If a PR is no longer needed or is invalid, it can be closed without
merging. Provide a reason for closing to maintain transparency.
</p>
</section>
<section>
<h2>Key Takeaways</h2>
<ul>
<li>Pull Requests are essential for collaboration and code review.</li>
<li>Follow best practices for creating and reviewing PRs.</li>
<li>
Use descriptive titles and detailed descriptions to communicate
changes effectively.
</li>
</ul>
</section>
<footer>
<p>Created by [Arman ihsan].</p>
</footer>
</body>
</html>