Skip to content

Commit ec548b3

Browse files
authored
Merge pull request #27 from aobolensk/01-git-update
Mention commit naming convention and advanced git operations in 01-git
2 parents 731827f + 88b6c69 commit ec548b3

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

01-git/01-git.tex

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,33 @@ \section{Basic Git commands}
213213
\end{itemize}
214214
\end{frame}
215215

216+
\begin{frame}{Conventional Commits}
217+
There are multiple examples of organizing commit messages naming (so called convention)
218+
219+
\footnotesize
220+
A lightweight convention for commit messages that enables readable history and automation. See \href{https://www.conventionalcommits.org/}{conventionalcommits.org}
221+
\begin{itemize}
222+
\item Format: \texttt{type(scope)!: subject}
223+
\item Common types: \texttt{feat}, \texttt{fix}, \texttt{docs}, \texttt{style},
224+
\texttt{refactor}, \texttt{test}, \texttt{chore}, \texttt{perf}, \texttt{build}, \texttt{ci}
225+
\item \textbf{scope} is optional; \textbf{subject} is imperative, no period
226+
\item Benefits: clear intent, auto changelogs, easier reviews, semantic versioning triggers
227+
\end{itemize}
228+
\end{frame}
229+
230+
\begin{frame}{Conventional Commits: Examples}
231+
\begin{block}{Examples}
232+
\texttt{feat(auth): add OAuth2 login}\newline
233+
\texttt{fix(api): handle 404 on users endpoint}\newline
234+
\texttt{docs(readme): clarify local setup steps}\newline
235+
\texttt{refactor(core)!: remove legacy sync path}\newline
236+
\texttt{BREAKING CHANGE: sync() removed; use syncAsync()}\newline
237+
\texttt{test(router): add coverage for redirects}
238+
\end{block}
239+
\vspace{0.4em}
240+
Tips: keep scope small; group commits by intent; reference issues when helpful (e.g., \texttt{fix: handle null refs (closes \#123)}).
241+
\end{frame}
242+
216243
\begin{frame}{Branches in Git}
217244
\footnotesize
218245
In Git, a branch represents an independent line of development, enabling you to work on different features, fixes, or experiments without affecting the main line of the project.\\
@@ -251,6 +278,53 @@ \section{Basic Git commands}
251278
\end{itemize}
252279
\end{frame}
253280

281+
\section{Advanced Git Operations}
282+
283+
\begin{frame}{Advanced Git Commands}
284+
\textbf{Stashing Changes}:
285+
\begin{itemize}
286+
\item Save work in progress without committing:
287+
\begin{block}{Commands}
288+
\texttt{git stash} - Save current changes\newline
289+
\texttt{git stash pop} - Apply and remove latest stash\newline
290+
\texttt{git stash list} - View all stashes
291+
\end{block}
292+
\end{itemize}
293+
294+
\textbf{Rebasing}:
295+
\begin{itemize}
296+
\item Rewrite commit history for cleaner timeline:
297+
\begin{block}{Commands}
298+
\texttt{git rebase main} - Replay commits on top of main\newline
299+
\texttt{git rebase -i HEAD~3} - Interactive rebase last 3 commits
300+
\end{block}
301+
\end{itemize}
302+
\end{frame}
303+
304+
\begin{frame}{Handling Merge Conflicts}
305+
\textbf{When Conflicts Occur}:
306+
\begin{itemize}
307+
\item Same file modified in different branches
308+
\item Automatic merge fails, manual resolution required
309+
\end{itemize}
310+
311+
\textbf{Resolution Process}:
312+
\begin{enumerate}
313+
\item Identify conflicted files: \texttt{git status}
314+
\item Open files and look for conflict markers:
315+
\begin{block}{Conflict Markers}
316+
\texttt{<<<<<<< HEAD}\newline
317+
\texttt{Your changes}\newline
318+
\texttt{=======}\newline
319+
\texttt{Incoming changes}\newline
320+
\texttt{>>>>>>> branch-name}
321+
\end{block}
322+
\item Edit files to resolve conflicts
323+
\item Stage resolved files: \texttt{git add <file>}
324+
\item Complete merge: \texttt{git commit}
325+
\end{enumerate}
326+
\end{frame}
327+
254328
\section{Git workflows overview}
255329

256330
\begin{frame}{Push to Master (Linear history approach)}
@@ -372,6 +446,7 @@ \section{Git workflows overview}
372446
\item Git Flow Tutorial by Atlassian \href{https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow}{https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow}
373447
\item Git Flow cheatsheet \href{https://danielkummer.github.io/git-flow-cheatsheet/}{https://danielkummer.github.io/git-flow-cheatsheet/}
374448
\item GitHub Flow Tutorial by GitHub \href{https://docs.github.com/en/get-started/using-github/github-flow}{https://docs.github.com/en/get-started/using-github/github-flow}
449+
\item Conventional Commits \href{https://www.conventionalcommits.org/}{https://www.conventionalcommits.org/}
375450
\end{enumerate}
376451
\end{frame}
377452

01-git/01-git.toc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
\beamer@sectionintoc {2}{What version control systems exist? History and evolution}{4}{0}{2}
33
\beamer@sectionintoc {3}{What is Git?}{7}{0}{3}
44
\beamer@sectionintoc {4}{Basic Git commands}{8}{0}{4}
5-
\beamer@sectionintoc {5}{Git workflows overview}{18}{0}{5}
5+
\beamer@sectionintoc {5}{Advanced Git Operations}{20}{0}{5}
6+
\beamer@sectionintoc {6}{Git workflows overview}{22}{0}{6}

0 commit comments

Comments
 (0)