@@ -307,6 +307,66 @@ \section{Advanced Git Operations}
307307 \end {itemize }
308308\end {frame }
309309
310+ \begin {frame }{Updating Feature Branch: Why}
311+ \footnotesize
312+ Keeping your feature branch current with \texttt {main } helps to:
313+ \begin {itemize }
314+ \item Reduce integration pain and surface conflicts early
315+ \item Ensure CI runs against the latest base code
316+ \item Keep PRs small, focused, and easy to review
317+ \item Avoid long-lived drift that complicates release
318+ \end {itemize }
319+ \end {frame }
320+
321+ \begin {frame }{Update via Merge}
322+ \footnotesize
323+ Preserve history by merging the latest \texttt {main } into your feature.
324+ \begin {block }{Commands}
325+ \texttt {git fetch origin }\newline
326+ \texttt {git checkout <feature> }\newline
327+ \texttt {git merge origin/main }
328+ \end {block }
329+ \begin {itemize }
330+ \item Pros: no history rewrite; safe for shared branches
331+ \item Cons: adds merge commits; history may be noisier
332+ \end {itemize }
333+ \end {frame }
334+
335+ \begin {frame }{Update via Rebase}
336+ \footnotesize
337+ Create a linear history by replaying your work on top of \texttt {main }.
338+ \begin {block }{Commands}
339+ \texttt {git fetch origin }\newline
340+ \texttt {git checkout <feature> }\newline
341+ \texttt {git rebase origin/main }
342+ \end {block }
343+ If conflicts: fix files, \texttt {git add <file> }, then \texttt {git rebase --continue }. To cancel: \texttt {git rebase --abort }.
344+ \begin {itemize }
345+ \item Pros: cleaner, linear history; easier to review
346+ \item Cons: rewrites commits; avoid on shared/public branches
347+ \end {itemize }
348+ \end {frame }
349+
350+ \begin {frame }{Cherry-pick a Commit}
351+ \footnotesize
352+ Apply (pick) an existing commit onto your current branch without merging entire branches.
353+ \begin {itemize }
354+ \item Common uses: bring a specific fix, backport a change.
355+ \item Usage:
356+ \begin {block }{Commands}
357+ \texttt {git cherry-pick <commit> } --- Apply a single commit\newline
358+ \texttt {git cherry-pick A..B } --- Apply a range (excludes A, up to B)\newline
359+ \texttt {git cherry-pick <c1> <c2> } --- Apply multiple commits
360+ \end {block }
361+ \item Useful flags:
362+ \begin {block }{Flags}
363+ \texttt {-x } --- Append `` cherry picked from commit hash (SHA)'' to the message\newline
364+ \texttt {-n } (\texttt {--no-commit }) --- Do not create a commit; leave changes staged
365+ \end {block }
366+ \end {itemize }
367+ It is called `` cherry-picking'' because you are selecting (or `` picking'' ) specific commits from one branch to apply to another, much like picking cherries from a tree.
368+ \end {frame }
369+
310370\begin {frame }{Handling Merge Conflicts}
311371 \textbf {When Conflicts Occur }:
312372 \begin {itemize }
0 commit comments