8000 Bugfix/findings by fliiiix · Pull Request #7 · segfault-trainings/gitworkshop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bugfix/findings #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 3, 2021
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
2 changes: 1 addition & 1 deletion project
Submodule project updated 3 files
+11 −0 assets.js
+1 −0 moon.html
+3 −7 moon.js
6 changes: 0 additions & 6 deletions sections/conflicts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ \subsection{Prepare a merge conflict}
\begin{lstlisting}
(*\textcolor[HTML]{18B2B2}{@@ -4,7 +4,7 @@}*)
// create moons
new Moon("blue");
new Moon("white");
(*\textcolor[HTML]{AA0000}{-}*)(*\textcolor[HTML]{AA0000}{new Moon("green");}*)
(*\textcolor[HTML]{00AA00}{+}*)(*\textcolor[HTML]{00AA00}{new Moon("red");}*)
Expand Down Expand Up @@ -49,7 +48,6 @@ \subsection{Prepare a merge conflict}
\begin{lstlisting}
(*\textcolor[HTML]{18B2B2}{@@ -4,7 +4,7 @@}*)
// create moons
new Moon("blue");
new Moon("white");
(*\textcolor[HTML]{AA0000}{-}*)(*\textcolor[HTML]{AA0000}{new Moon("green");}*)
(*\textcolor[HTML]{00AA00}{+}*)(*\textcolor[HTML]{00AA00}{new Moon("green"); // the moon was sooo green!}*)
Expand Down Expand Up @@ -97,7 +95,6 @@ \subsection{Displaying conflicts}
+++ b/moon.js
(*\textcolor[HTML]{18B2B2}{@@@ -4,7 -4,7 +4,11 @@@}*)
// create moons
new Moon("blue");
new Moon("white");
(*\textcolor[HTML]{00AA00}{++}*)(*\textcolor[HTML]{00AA00}{<<<<<<< HEAD}*)
(*\textcolor[HTML]{00AA00}{+}*) (*\textcolor[HTML]{00AA00}{new Moon("red");}*)
Expand Down Expand Up @@ -194,7 +191,6 @@ \subsection{Preparing rebase conflict}
Implement the change in \cmd{moon.js} following this diff:

\begin{lstlisting}
new Moon("blue");
(*\textcolor[HTML]{AA0000}{-}*)(*\textcolor[HTML]{AA0000}{new Moon("white");}*)
(*\textcolor[HTML]{00AA00}{+}*)(*\textcolor[HTML]{00AA00}{new Moon("black");}*)
new Moon("red");
Expand All @@ -218,7 +214,6 @@ \subsection{Preparing rebase conflict}

Modify the moon.js file accordingly:
\begin{lstlisting}
new Moon("blue");
(*\textcolor[HTML]{AA0000}{-}*)(*\textcolor[HTML]{AA0000}{new Moon("white");}*)
(*\textcolor[HTML]{00AA00}{+}*)(*\textcolor[HTML]{00AA00}{new Moon("white"); // as snow}*)
new Moon("red");
Expand Down Expand Up @@ -267,7 +262,6 @@ \subsection{Display conflict}
--- a/moon.js
+++ b/moon.js
(*\textcolor[HTML]{18B2B2}{@@@ -4,7 -4,7 +4,11 @@@}*)
new Moon("blue");
(*\textcolor[HTML]{00AA00}{++}*)(*\textcolor[HTML]{00AA00}{<<<<<<< d5d25c1555e1137d3ecd3bf335d3ac3515605bf4}*)
(*\textcolor[HTML]{00AA00}{+}*) (*\textcolor[HTML]{00AA00}{new Moon("white"); // as snow}*)
(*\textcolor[HTML]{00AA00}{++}*)(*\textcolor[HTML]{00AA00}{=======}*)
Expand Down
6 changes: 3 additions & 3 deletions sections/getting-started.tex
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ \subsection{Workshop git project}
\begin{lstlisting}
$ (*\textcolor[HTML]{0000AA}{cd gitmoon}*)
$ (*\textcolor[HTML]{0000AA}{ls}*)
assets moon.html moon.js
assets assets.js moon.html moon.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off-topic: is this assets folder still relevant when we have the assets.js ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not used in any way at the moment but I opted to keep it because it contains the images in a non base64 form.

\end{lstlisting}

\vspace{1em}
Expand Down Expand Up @@ -133,7 +133,7 @@ \subsection{Create .gitignore}
\vspace{2em}
Let's create a .gitignore file ignoring temporary vim swp files:
\begin{lstlisting}
$ (*\textcolor[HTML]{0000AA}{echo '*.swp' > .gitignore}*)
$ (*\textcolor[HTML]{0000AA}{echo "*.swp" > .gitignore}*)
\end{lstlisting}

Let's see what the status of the repository with the \cmd{git status} command:
Expand Down Expand Up @@ -172,7 +172,7 @@ \subsection{Adding a file}

Let's create an AUTHORS file with your name:
\begin{lstlisting}
$ (*\textcolor[HTML]{0000AA}{echo Tux Penguin > AUTHORS}*)
$ (*\textcolor[HTML]{0000AA}{echo "Tux Penguin" > AUTHORS}*)
\end{lstlisting}

Check the git status:
Expand Down
32 changes: 32 additions & 0 deletions sections/making-a-change.tex
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,38 @@ \subsection{Fixup commits}
Save and quit the editor to fixup the commits.
\end{frame}


\subsection{Fixup commits}
\begin{frame}[fragile]
\subslidetitle
\begin{lstlisting}
$ (*\textcolor[HTML]{0000AA}{git log --oneline}*)
(*\textcolor[HTML]{ae6617}{633a534}*) change the green moon to red
(*\textcolor[HTML]{ae6617}{368a328}*) remove the blue moon
\end{lstlisting}

Let's fix something in the 'remove the blue moon' commit.
And commit that as fixup:
\begin{lstlisting}
git commit -a --fixup=368a328
\end{lstlisting}

Now our git log should look like this:
\begin{lstlisting}
$ (*\textcolor[HTML]{0000AA}{git log --oneline}*)
(*\textcolor[HTML]{ae6617}{ca78a62}*) fixup! remove the blue moon
(*\textcolor[HTML]{ae6617}{633a534}*) change the green moon to red
(*\textcolor[HTML]{ae6617}{368a328}*) remove the blue moon
\end{lstlisting}

Which allows us to automatically put them in the right place in a interactive rebase.
\begin{lstlisting}
$ git rebase -i HEAD~3 --autosquash
\end{lstlisting}

\end{frame}


\subsection{Squash commits}
\begin{frame}[fragile]
\subslidetitle
Expand Down
5 changes: 5 additions & 0 deletions sections/remotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ \subsection{Forking Workflow - Clone}
\begin{frame}[fragile]
\subslidetitle

For the next step you should be outside the gitmoon project folder.

\begin{lstlisting}
$ cd ~
$ (*\textcolor[HTML]{0000AA}{git clone https://github.com/<YOUR USERNAME>/agile-ipsum.git}*)
...

Expand All @@ -159,6 +162,8 @@ \subsection{Forking Workflow - Clone}
Fetch URL: https://github.com/<YOUR USERNAME>/agile-ipsum.git
Push URL: https://github.com/<YOUR USERNAME>/agile-ipsum.git
HEAD branch: master

$ cd agile-ipsum
\end{lstlisting}

\end{frame}
Expand Down
0