Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions 01-git/01-git.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.\\
Expand Down Expand Up @@ -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 <file>}
\item Complete merge: \texttt{git commit}
\end{enumerate}
\end{frame}

\section{Git workflows overview}

\begin{frame}{Push to Master (Linear history approach)}
Expand Down Expand Up @@ -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}

Expand Down
3 changes: 2 additions & 1 deletion 01-git/01-git.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Loading