commit ea0d4d7f0287b6779b62276ce11a0b77100dc684 Author: coolneng Date: Fri Nov 5 15:46:13 2021 +0100 Create the first version of the presentation diff --git a/Presentation.org b/Presentation.org new file mode 100644 index 0000000..2502b7e --- /dev/null +++ b/Presentation.org @@ -0,0 +1,71 @@ +#+TITLE: Git 101 +#+AUTHOR: Amin Kasrou Aouam +#+PANDOC_OPTIONS: pdf-engine:xelatex +#+PANDOC_METADATA: theme:metropolis +* Concepts +- Version control system (VCS) +- Distributed +- /De facto/ standard for code collaboration +* Reality +- Powerful system with hard to grasp concepts + +#+CAPTION: xkcd +#+ATTR_HTML: :width 170 +[[./assets/xkcd.png]] +* Structure of a git project +- The working directory is the folder where we want to manage our project +- The index is an intermediary step between the files in the directory and the commits +- A commit is a full snapshot (i.e. copy) of the contents of the working directory at some point + +#+CAPTION: Structure of a project +#+ATTR_HTML: :width 300 +[[./assets/staging.png]] +* Branches +- A branch is a way to diverge from the commits +- It allows multiple people to work on the same project without conflicts +[[./assets/branch.png]] +[[./assets/divergence.png]] +* Remotes +- The real advantage of git is allowing multiple people to work on the same project from different locations +- A server is used to synchronize the changes between the developers +#+CAPTION: Remote repositories +#+ATTR_HTML: :width 300 +[[./assets/remote.png]] +* Merges +- The development of the developers has to be combined at some point +- We can merge a branch on another, importing all the changes that were done +#+CAPTION: Merging the branches Test and Master +#+ATTR_HTML: :width 300 +[[./assets/merge.png]] +* Cheatsheet + +- Add a file to the index + +#+begin_src bash +git add file +#+end_src + +- Commit the changes + +#+begin_src bash +git commit +#+end_src + + +- Change the branch + +#+begin_src bash +git checkout branch_name +#+end_src + +- Send the changes to the server + +#+begin_src bash +git push +#+end_src + +- Get the changes from the server + +#+begin_src bash +git pull +#+end_src diff --git a/Presentation.pdf b/Presentation.pdf new file mode 100644 index 0000000..5ef8490 Binary files /dev/null and b/Presentation.pdf differ diff --git a/assets/branch.png b/assets/branch.png new file mode 100644 index 0000000..c527bb5 Binary files /dev/null and b/assets/branch.png differ diff --git a/assets/commit.png b/assets/commit.png new file mode 100644 index 0000000..d242192 Binary files /dev/null and b/assets/commit.png differ diff --git a/assets/divergence.png b/assets/divergence.png new file mode 100644 index 0000000..627d741 Binary files /dev/null and b/assets/divergence.png differ diff --git a/assets/merge.png b/assets/merge.png new file mode 100644 index 0000000..5f93494 Binary files /dev/null and b/assets/merge.png differ diff --git a/assets/remote.png b/assets/remote.png new file mode 100644 index 0000000..6080c82 Binary files /dev/null and b/assets/remote.png differ diff --git a/assets/staging.png b/assets/staging.png new file mode 100644 index 0000000..9f6a4ef Binary files /dev/null and b/assets/staging.png differ diff --git a/assets/xkcd.png b/assets/xkcd.png new file mode 100644 index 0000000..fd51673 Binary files /dev/null and b/assets/xkcd.png differ