Commit 7c6b69f0 authored by  Joe  Rackham's avatar Joe Rackham
Browse files

Add rebasing section

parent 705d327c
...@@ -7,10 +7,13 @@ ...@@ -7,10 +7,13 @@
\@writefile{toc}{\contentsline {section}{\numberline {3}Branching \& Merging}{1}} \@writefile{toc}{\contentsline {section}{\numberline {3}Branching \& Merging}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Creating a new branch}{1}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Creating a new branch}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Fast-Forward Merging}{1}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Fast-Forward Merging}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}3-Way Merging}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {4}Workflow}{2}} \@writefile{toc}{\contentsline {section}{\numberline {4}Workflow}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Committing}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Committing}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Stashing}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Stashing}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Tracking Changes}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Tracking Changes}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Undoing Changes}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Undoing Changes}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.5}Maintenance}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {4.5}Maintenance}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6}Rewriting History}{2}} \@writefile{toc}{\contentsline {section}{\numberline {5}Rebasing}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Changing the base}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Interactive Mode}{3}}
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2020.3.23) 23 MAR 2020 10:26 This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2020.3.23) 23 MAR 2020 11:34
entering extended mode entering extended mode
restricted \write18 enabled. restricted \write18 enabled.
%&-line parsing enabled. %&-line parsing enabled.
...@@ -231,26 +231,26 @@ LaTeX Font Info: External font `cmex10' loaded for size ...@@ -231,26 +231,26 @@ LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 30. (Font) <5> on input line 30.
[1 [1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] (./main.aux) ) {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] [3] (./main.aux) )
Here is how much of TeX's memory you used: Here is how much of TeX's memory you used:
2104 strings out of 494923 2104 strings out of 494923
30036 string characters out of 6180742 30036 string characters out of 6180742
91561 words of memory out of 5000000 92561 words of memory out of 5000000
5406 multiletter control sequences out of 15000+600000 5406 multiletter control sequences out of 15000+600000
7755 words of font info for 28 fonts, out of 8000000 for 9000 7755 words of font info for 28 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191 14 hyphenation exceptions out of 8191
41i,6n,32p,271b,187s stack positions out of 5000i,500n,10000p,200000b,80000s 41i,6n,32p,271b,187s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/sh </us
are/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/te r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/shar
xlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/t e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texli
exmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-di ve/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texm
st/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/font f-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/
s/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/
1/public/amsfonts/cm/cmtt10.pfb> type1/public/amsfonts/cm/cmtt10.pfb>
Output written on main.pdf (2 pages, 76356 bytes). Output written on main.pdf (3 pages, 77812 bytes).
PDF statistics: PDF statistics:
35 PDF objects out of 1000 (max. 8388607) 38 PDF objects out of 1000 (max. 8388607)
24 compressed objects within 1 object stream 26 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000) 0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000) 1 words of extra memory for PDF output out of 10000 (max. 10000000)
No preview for this file type
No preview for this file type
...@@ -56,9 +56,16 @@ ...@@ -56,9 +56,16 @@
Can ONLY be use when there is a linear path to the branch head from the parent head: Can ONLY be use when there is a linear path to the branch head from the parent head:
\begin{verbatim} \begin{verbatim}
git checkout *parent_branch* git checkout *parent_branch*
git merger *child_branch* git merge *child_branch*
\end{verbatim} \end{verbatim}
\subsection{3-Way Merging}
\begin{itemize}
\item The normal merging scenario
\item We merge the original branch into the branch first before merging the branch back
\item This causes a messy commit graph
\end{itemize}
\section{Workflow} \section{Workflow}
\subsection{Committing} \subsection{Committing}
\begin{itemize} \begin{itemize}
...@@ -105,12 +112,33 @@ Reset: ...@@ -105,12 +112,33 @@ Reset:
\item \texttt{git rm} removes a file from the working directory and the git index \item \texttt{git rm} removes a file from the working directory and the git index
\end{itemize} \end{itemize}
\subsection{Rewriting History}
\section{Rebasing}
\subsection{Changing the base}
\begin{itemize}
\item The primary goal of rebasing is to change the base of the working directory
\item \texttt{git rebase *base*} will change the base of commits made on the remote repo to be the specified commit
\item If we are working on a branch this creates a linear history; can do a fast-forward merge
\item The specified base can either be a commit hash or \texttt{HEAD~*num*} specifying a number of commits backwards from the HEAD
\end{itemize}
\subsection{Interactive Mode}
\begin{itemize} \begin{itemize}
\item \texttt{git rebase} facilitates changing multiple or older commits \item Rebasing with \texttt{-i} option turns on interactive mode
\item Public commits should never be rebased \item We can change the option for each commit
\item \texttt{git squash} uses rebasing to combine multiple commits into one for a clean history
\end{itemize} \end{itemize}
\begin{tabular}{|l|l|}
\hline
pick & The commit is included unchanged \\ \hline
reword & The commit is included with a reworded commit msg \\ \hline
edit & Rebasing will pause so the commit can be ammended \\ \hline
squash & The commit will be merged into the previous \\ \hline
drop & Remove commit \\ \hline
\end{tabular}
\end{document} \end{document}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment