WIP: git slides WIP
This commit is contained in:
parent
951f34afdb
commit
d53435b390
1 changed files with 151 additions and 25 deletions
|
@ -1,8 +1,12 @@
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
---
|
||||||
title = "Git"
|
title: "Intro to git"
|
||||||
date = 2024-09-18
|
sub_title: "Force push"
|
||||||
slides = true
|
author: "Prabuddha Hans"
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
date: "2025-09-22"
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: catppuccin-latte
|
||||||
|
---
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
|
|
||||||
|
@ -10,231 +14,342 @@ slides = true
|
||||||
|
|
||||||
Git is tool that's used in the programming industry.
|
Git is tool that's used in the programming industry.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Another name for Git is a Version Control System (VCS) tool.
|
Another name for Git is a Version Control System (VCS) tool.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Specifically to track project work done, and the changes to files we've made.
|
Specifically to track project work done, and the changes to files we've made.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
The more correct term is Source Control.
|
The more correct term is Source Control.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
It is NOT a programming language.
|
It is NOT a programming language.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Git is a tool made for (usually) us programmers to track the work we've done.
|
Git is a tool made for (usually) us programmers to track the work we've done.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Programmer socks (not) included.
|
Programmer socks (not) included.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Now we need to ask WHY.
|
Now we need to ask WHY.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Why would we need a tool like this?
|
Why would we need a tool like this?
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Why not use Google Drive instead?
|
Why not use Google Drive instead?
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
I will find your IP address.
|
I will find your IP address.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
In all honesty,
|
In all honesty,
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
It's to help keep track of who did what.
|
It's to help keep track of who did what.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
And to work on unique features...
|
And to work on unique features...
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
without affecting the main area/branch of our work.
|
without affecting the main area/branch of our work.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
When DO we use git?
|
When DO we use git?
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Because Git keeps track of the changes we've made to files,
|
Because Git keeps track of the changes we've made to files,
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
We can then use it to commit and stage these files,
|
We can then use it to commit and stage these files,
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
and push them to a place where we can store them.
|
and push them to a place where we can store them.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
This place is called a Repository.
|
This place is called a Repository.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Repositories are hosted on websites like GitLab, GitHub and Forgejo.
|
Repositories are hosted on websites like GitLab, GitHub and Forgejo.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
But, an interesting feature of git, is that it allows you to time-travel.
|
But, an interesting feature of git, is that it allows you to time-travel.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Meaning that if a project breaks, you can go back to before it broke.
|
Meaning that if a project breaks, you can go back to before it broke.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Now I hear you in the audience asking...
|
Now I hear you in the audience asking...
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Why not use SVN?
|
Why not use SVN?
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
The answer is simple.
|
The answer is simple.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
An actual answer is that Git is Distributed, and SVN in centralized.
|
An actual answer is that Git is Distributed, and SVN in centralized.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Simply put, devs can store their changes locally on their machines,
|
Simply put, devs can store their changes locally on their machines,
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
where on SVN they're stored on a central system.
|
where on SVN they're stored on a central system.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
With a central system you NEED to be connected at all times to work on it.
|
With a central system you NEED to be connected at all times to work on it.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
You can work locally on git without having to be connected,
|
You can work locally on git without having to be connected,
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
and then push once you're reconnected.
|
and then push once you're reconnected.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Back to git.
|
Back to git.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Let's start with the basics.
|
Let's start with the basics.
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
# Live demonstration time
|
# Live demonstration time
|
||||||
|
|
||||||
Please get your laptop out
|
Please get your laptop out
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
How to download git & git LFS
|
How to download git & git LFS
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
<<https://git-scm.com/downloads>>
|
<<https://git-scm.com/downloads>>
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
<!-- end_slide -->
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
<<https://forgejo.skynet.ie/Skynet/deploy_user>>
|
<<https://forgejo.skynet.ie/Skynet/deploy_user>>
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
Don't do this
|
Don't do this
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
LFS Install
|
LFS Install
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
````bash
|
````bash
|
||||||
git lfs install
|
git lfs install
|
||||||
````
|
````
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Setup SSH key (see Readme.md))
|
Setup SSH key (see Readme.md))
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
<!-- end_slide -->
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -246,24 +361,35 @@ git add <file_name>
|
||||||
git commit -m "<commit_message>"
|
git commit -m "<commit_message>"
|
||||||
git push origin <branch_name>
|
git push origin <branch_name>
|
||||||
````
|
````
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
``https://<username>.users.skynet.ie/``
|
``https://<username>.users.skynet.ie/``
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
TroubleShooting
|
TroubleShooting
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
If you see this:
|
If you see this:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> Credit: Geeks for Geeks
|
> Credit: Geeks for Geeks
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Go here: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
|
Go here: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
|
||||||
|
|
||||||
|
<!-- end_slide -->
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
Loading…
Add table
Add a link
Reference in a new issue