Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
|
b8703bf5b2 | ||
|
66b821ed13 | ||
|
c1772650cb | ||
|
a32b3f58b3 | ||
|
d53435b390 | ||
|
951f34afdb |
18 changed files with 295 additions and 0 deletions
244
slides/compsoc/2025-2025/intro_to_git.md
Normal file
244
slides/compsoc/2025-2025/intro_to_git.md
Normal file
|
@ -0,0 +1,244 @@
|
|||
---
|
||||
title: "Intro to git"
|
||||
sub_title: "git push -f origin main"
|
||||
author: "Prabuddha Hans"
|
||||
date: "2025-09-22"
|
||||
|
||||
theme:
|
||||
name: catppuccin-latte
|
||||
---
|
||||
|
||||
Git
|
||||
=================================
|
||||
|
||||
<!-- incremental_lists: true -->
|
||||
|
||||
* Git is tool that's used in the programming industry.
|
||||
* Another name for Git is a Version Control System (VCS) tool.
|
||||
* 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.
|
||||
* Git is a tool made for (usually) us programmers to track the work we've done.
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Sold Separately
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||
Programmer socks (not) included.
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Why Git
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||
<!-- incremental_lists: true -->
|
||||
|
||||
* Now we need to ask 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 of our work.
|
||||
* 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.
|
||||
<!-- end_slide -->
|
||||
|
||||
Code Storage
|
||||
=================================
|
||||
|
||||
<!-- alignment: center -->
|
||||
<!-- incremental_lists: true -->
|
||||
|
||||
* This place is called a Repository.
|
||||
* Repositories are hosted on websites like GitLab, GitHub and Forgejo.
|
||||
* 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 nerds in the audience asking...
|
||||
* Why not use SVN?
|
||||
* The answer is simple.
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
No.
|
||||
=================================
|
||||
|
||||
<!-- alignment: center -->
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
WHY don't we use SVN
|
||||
=================================
|
||||
|
||||
<!-- alignment: center -->
|
||||
<!-- incremental_lists: true -->
|
||||
|
||||
* An actual answer is that Git is Distributed, and SVN in centralized.
|
||||
* Simply put, devs can store their changes locally on their machines.
|
||||
* Whereas 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.
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Live demonstration time
|
||||
=================================
|
||||
<!-- font_size: 5 -->
|
||||
<!-- alignment: center -->
|
||||
|
||||
* Please get your laptops out
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
How to download Git & Git LFS
|
||||
=================================
|
||||
|
||||
<!-- alignment: center -->
|
||||
|
||||
## Download
|
||||
<<https://git-scm.com/downloads>>
|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||
<https://forgejo.skynet.ie/Skynet/deploy_user>
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Don't do these types of commit messages
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

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

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||
LFS Install
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||
<https://git-lfs.com/>
|
||||
|
||||
Same deal as before, just download and install.
|
||||
It'll ask to be ran as Administrator, say yes.
|
||||
<!-- end_slide -->
|
||||
|
||||
Setup SSH key (see Readme.md)
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||
```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>
|
||||
```
|
||||
|
||||
<!-- end_slide -->
|
||||
<!-- alignment: center -->
|
||||
|
||||
``https://<username>.users.skynet.ie/``
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
TroubleShooting
|
||||
=================================
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
If you see this:
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||

|
||||
|
||||
> Credit: Geeks for Geeks
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Go here
|
||||
=================================
|
||||
<!-- alignment: center -->
|
||||
|
||||
<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 -->
|
BIN
slides/compsoc/2025-2025/intro_to_git/NAH.jpg
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/NAH.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/bad_message.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/bad_message.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/compsocks.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/compsocks.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_add_secret.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_add_secret.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_repo_link.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_repo_link.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_repo_settings.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_repo_settings.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_secrets_location.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_secrets_location.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_ssh_key_example.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_ssh_key_example.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_template_button.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_template_button.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_template_repo_creation.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/forgejo_template_repo_creation.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_download_button.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_download_button.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_checkout_unix.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_checkout_unix.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_default_rebase_pull.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_default_rebase_pull.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_notepad_as_default_editor.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_notepad_as_default_editor.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_rename_master_to_main.png
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/git_installer_rename_master_to_main.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
slides/compsoc/2025-2025/intro_to_git/permission_denied_publickey.jpg
(Stored with Git LFS)
Normal file
BIN
slides/compsoc/2025-2025/intro_to_git/permission_denied_publickey.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue