Compare commits

...

8 commits
main ... main

Author SHA1 Message Date
Prabuddha Hans
f4741c8889 Feat: Introductory git commands 2024-09-25 15:22:17 +01:00
Prabuddha Hans
9fb641c1e0 Working on getting the idea of time-travel to make sense 2024-09-23 22:15:32 +01:00
Prabuddha Hans
bc322c0ee7 Fix: formatting 2024-09-22 21:13:31 +01:00
Prabuddha Hans
5399154a5e resolved slight merge conflict 2024-09-19 11:12:17 +01:00
Prabuddha Hans
733fe359fa Added a bit on commit messages and pulling 2024-09-19 11:09:46 +01:00
Prabuddha Hans
f86fe81411 Added a bit more to the slides 2024-09-18 22:07:13 +01:00
Prabuddha Hans
b267df10ef Last bit of the slides 2024-09-18 14:54:38 +01:00
Prabuddha Hans
3a9b4d12c6 Git slides WIP 2024-09-15 18:27:09 +01:00
3 changed files with 224 additions and 0 deletions

218
src/slides/compsoc/3_git.md Normal file
View file

@ -0,0 +1,218 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
-------------------------------------------------------------------------
Don't do this
![BAD](3_git/bad_message.png)
-------------------------------------------------------------------------
Please do this
````git pull <remote_name> <branch_name>````
-------------------------------------------------------------------------
````git init````
-------------------------------------------------------------------------
````git remote add origin <repo_url>````
-------------------------------------------------------------------------
````git add <file_name>````
-------------------------------------------------------------------------
````git commit -m <Commit message>````
-------------------------------------------------------------------------
````git pull origin <branch_name>````
-------------------------------------------------------------------------
````git push origin <branch_name>````
-------------------------------------------------------------------------

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

Binary file not shown.