From a32b3f58b33175822493ade3f179e09f43f31a74 Mon Sep 17 00:00:00 2001 From: Nanda128 Date: Mon, 22 Sep 2025 17:09:48 +0100 Subject: [PATCH] slides: update sub-title and improve content for clarity --- slides/compsoc/2025-2025/intro_to_git.md | 194 ++++++++++++------ .../2025-2025/intro_to_git/compsocks.png | 3 + 2 files changed, 132 insertions(+), 65 deletions(-) create mode 100644 slides/compsoc/2025-2025/intro_to_git/compsocks.png diff --git a/slides/compsoc/2025-2025/intro_to_git.md b/slides/compsoc/2025-2025/intro_to_git.md index c2972fd..a1d6c20 100644 --- a/slides/compsoc/2025-2025/intro_to_git.md +++ b/slides/compsoc/2025-2025/intro_to_git.md @@ -1,6 +1,6 @@ --- title: "Intro to git" -sub_title: "Force push" +sub_title: "git push -f origin main" author: "Prabuddha Hans" date: "2025-09-22" @@ -10,348 +10,407 @@ theme: # Git -------------------------------------------------------------------------- +================================= 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. + -------------------------------------------------------------------------- +================================= Programmer socks (not) included. +![image:width:100%](intro_to_git/compsocks.png) + + -------------------------------------------------------------------------- +================================= 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. + -------------------------------------------------------------------------- +================================= 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 in the audience asking... + -------------------------------------------------------------------------- +================================= Why not use SVN? + -------------------------------------------------------------------------- +================================= The answer is simple. + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_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 +Please get your laptops out + -------------------------------------------------------------------------- +================================= -How to download git & git LFS +How to download Git & Git LFS + -------------------------------------------------------------------------- +================================= ## Download <> + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_download_button.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_installer.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_installer_notepad_as_default_editor.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_installer_rename_master_to_main.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_installer_checkout_unix.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/git_installer_default_rebase_pull.png) + -------------------------------------------------------------------------- +================================= <> + -------------------------------------------------------------------------- +================================= Don't do this ![image:width:100%](intro_to_git/bad_message.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_template_button.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_template_repo_creation.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_repo_link.png) + -------------------------------------------------------------------------- +================================= LFS Install + -------------------------------------------------------------------------- +================================= ````bash git lfs install ```` + -------------------------------------------------------------------------- +================================= Setup SSH key (see Readme.md)) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_repo_settings.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_secrets_location.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_add_secret.png) + -------------------------------------------------------------------------- +================================= ![image:width:100%](intro_to_git/forgejo_ssh_key_example.png) + -------------------------------------------------------------------------- +================================= ````bash git init @@ -362,21 +421,24 @@ git commit -m "" git push origin ```` + -------------------------------------------------------------------------- +================================= ``https://.users.skynet.ie/`` + -------------------------------------------------------------------------- +================================= TroubleShooting + -------------------------------------------------------------------------- +================================= If you see this: @@ -384,12 +446,14 @@ If you see this: > Credit: Geeks for Geeks + -------------------------------------------------------------------------- +================================= 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 + -------------------------------------------------------------------------- \ No newline at end of file +================================= diff --git a/slides/compsoc/2025-2025/intro_to_git/compsocks.png b/slides/compsoc/2025-2025/intro_to_git/compsocks.png new file mode 100644 index 0000000..ea19868 --- /dev/null +++ b/slides/compsoc/2025-2025/intro_to_git/compsocks.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5036242eb90cfc6ed14ce104354c3dfd0838293c11bed525adf413b6c6138b6d +size 79001