Merge branch 'main' of https://forgejo.skynet.ie/Computer_Society/presentations_compsoc
This commit is contained in:
commit
f71419f0f5
16 changed files with 314 additions and 0 deletions
269
src/slides/compsoc/3_git.md
Normal file
269
src/slides/compsoc/3_git.md
Normal file
|
@ -0,0 +1,269 @@
|
||||||
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
title = "Git"
|
||||||
|
date = 2024-09-18
|
||||||
|
slides = true
|
||||||
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
# Git
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
The 4 Ws of Git
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WHAT is Git?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WHO is Git made for?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WHY is Git used?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WHEN is Git used?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Last but not least, HOW do we use Git?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Let's start with the WHAT
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Git is tool that's used in the programming Industry.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Specifically to track project work done, and the changes to files we've made.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
The more correct term is Source Control.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
It is NOT a programming language.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Now we move onto the WHO.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Git is a tool made for (usually) us programmers to track the work we've done.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Programmer socks (not) included.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Now we need to ask the WHY.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Why would we need a tool like this?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Why not use Google Drive instead?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
I will find your IP address.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
In all honesty,
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
It's to help keep track of who did what.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
And to work on unique features...
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
without affecting the main area/branch (we'll return to this) of our work.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Now finally the WHEN.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
When DO we use git?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Because Git keeps track of the changes we've made to files,
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
We can then use it to commit and stage these files,
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
and push them to a place where we can store them.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
This place is called a Repository.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
But, an interesting feature of git, is that it allows you to time-travel.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Meaning that if a project breaks, you can go back to before it broke.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Now I hear you in the audience asking...
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Why not use SVN?
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
The answer is simple.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![NAH](3_git/NAH.jpg)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
An actual answer is that Git is Distributed, and SVN in centralized.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Simply put, devs can store their changes locally on their machines,
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
where on SVN they're stored on a central system.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
With a central system you NEED to be connected at all times to work on it.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
You can work locally on git without having to be connected,
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
and then push once you're reconnected.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Back to git.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Let's start with the basics.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Live demonstration time
|
||||||
|
|
||||||
|
Please get your laptop out
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
How to download git & git LFS
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
## Download
|
||||||
|
<<https://git-scm.com/downloads>>
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img.png](img.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_1.png](img_1.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_2.png](img_2.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_3.png](img_3.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_4.png](img_4.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_5.png](img_5.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
<<https://forgejo.skynet.ie/Skynet/deploy_user>>
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
Don't do this
|
||||||
|
![BAD](3_git/bad_message.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_6.png](img_6.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_7.png](img_7.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_8.png](img_8.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Setup SSH key (see Readme.md))
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_9.png](img_9.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_10.png](img_10.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_12.png](img_12.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
![img_11.png](img_11.png)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
````bash
|
||||||
|
git init
|
||||||
|
git remote add origin <repo_url>
|
||||||
|
git pull origin <branch_name>
|
||||||
|
git add <file_name>
|
||||||
|
git commit -m "<commit_message>"
|
||||||
|
git push origin <branch_name>
|
||||||
|
````
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
``https://<username>.users.skynet.ie/``
|
BIN
src/slides/compsoc/3_git/NAH.jpg
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/3_git/NAH.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/3_git/bad_message.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/3_git/bad_message.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_1.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_10.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_10.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_11.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_11.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_12.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_12.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_2.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_2.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_3.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_3.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_4.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_4.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_5.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_5.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_6.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_6.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_7.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_7.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_8.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_8.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/slides/compsoc/img_9.png
(Stored with Git LFS)
Normal file
BIN
src/slides/compsoc/img_9.png
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in a new issue