From 88b6c696b376fd5259f4ceaadf0cd2813d89bf72 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Mon, 25 Aug 2025 13:59:00 +0200 Subject: [PATCH] Mention commit naming convention and advanced git operations in 01-git --- 01-git/01-git.tex | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 01-git/01-git.toc | 3 +- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/01-git/01-git.tex b/01-git/01-git.tex index 65b70ed..1c43648 100644 --- a/01-git/01-git.tex +++ b/01-git/01-git.tex @@ -213,6 +213,33 @@ \section{Basic Git commands} \end{itemize} \end{frame} +\begin{frame}{Conventional Commits} + There are multiple examples of organizing commit messages naming (so called convention) + + \footnotesize + A lightweight convention for commit messages that enables readable history and automation. See \href{https://www.conventionalcommits.org/}{conventionalcommits.org} + \begin{itemize} + \item Format: \texttt{type(scope)!: subject} + \item Common types: \texttt{feat}, \texttt{fix}, \texttt{docs}, \texttt{style}, + \texttt{refactor}, \texttt{test}, \texttt{chore}, \texttt{perf}, \texttt{build}, \texttt{ci} + \item \textbf{scope} is optional; \textbf{subject} is imperative, no period + \item Benefits: clear intent, auto changelogs, easier reviews, semantic versioning triggers + \end{itemize} +\end{frame} + +\begin{frame}{Conventional Commits: Examples} + \begin{block}{Examples} + \texttt{feat(auth): add OAuth2 login}\newline + \texttt{fix(api): handle 404 on users endpoint}\newline + \texttt{docs(readme): clarify local setup steps}\newline + \texttt{refactor(core)!: remove legacy sync path}\newline + \texttt{BREAKING CHANGE: sync() removed; use syncAsync()}\newline + \texttt{test(router): add coverage for redirects} + \end{block} + \vspace{0.4em} + Tips: keep scope small; group commits by intent; reference issues when helpful (e.g., \texttt{fix: handle null refs (closes \#123)}). +\end{frame} + \begin{frame}{Branches in Git} \footnotesize 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} \end{itemize} \end{frame} +\section{Advanced Git Operations} + +\begin{frame}{Advanced Git Commands} + \textbf{Stashing Changes}: + \begin{itemize} + \item Save work in progress without committing: + \begin{block}{Commands} + \texttt{git stash} - Save current changes\newline + \texttt{git stash pop} - Apply and remove latest stash\newline + \texttt{git stash list} - View all stashes + \end{block} + \end{itemize} + + \textbf{Rebasing}: + \begin{itemize} + \item Rewrite commit history for cleaner timeline: + \begin{block}{Commands} + \texttt{git rebase main} - Replay commits on top of main\newline + \texttt{git rebase -i HEAD~3} - Interactive rebase last 3 commits + \end{block} + \end{itemize} +\end{frame} + +\begin{frame}{Handling Merge Conflicts} + \textbf{When Conflicts Occur}: + \begin{itemize} + \item Same file modified in different branches + \item Automatic merge fails, manual resolution required + \end{itemize} + + \textbf{Resolution Process}: + \begin{enumerate} + \item Identify conflicted files: \texttt{git status} + \item Open files and look for conflict markers: + \begin{block}{Conflict Markers} + \texttt{<<<<<<< HEAD}\newline + \texttt{Your changes}\newline + \texttt{=======}\newline + \texttt{Incoming changes}\newline + \texttt{>>>>>>> branch-name} + \end{block} + \item Edit files to resolve conflicts + \item Stage resolved files: \texttt{git add } + \item Complete merge: \texttt{git commit} + \end{enumerate} +\end{frame} + \section{Git workflows overview} \begin{frame}{Push to Master (Linear history approach)} @@ -372,6 +446,7 @@ \section{Git workflows overview} \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} \item Git Flow cheatsheet \href{https://danielkummer.github.io/git-flow-cheatsheet/}{https://danielkummer.github.io/git-flow-cheatsheet/} \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} + \item Conventional Commits \href{https://www.conventionalcommits.org/}{https://www.conventionalcommits.org/} \end{enumerate} \end{frame} diff --git a/01-git/01-git.toc b/01-git/01-git.toc index 266ee8e..fc2d9ad 100644 --- a/01-git/01-git.toc +++ b/01-git/01-git.toc @@ -2,4 +2,5 @@ \beamer@sectionintoc {2}{What version control systems exist? History and evolution}{4}{0}{2} \beamer@sectionintoc {3}{What is Git?}{7}{0}{3} \beamer@sectionintoc {4}{Basic Git commands}{8}{0}{4} -\beamer@sectionintoc {5}{Git workflows overview}{18}{0}{5} +\beamer@sectionintoc {5}{Advanced Git Operations}{20}{0}{5} +\beamer@sectionintoc {6}{Git workflows overview}{22}{0}{6}