SlideShare a Scribd company logo
On Campus UNSTPB
Welcome to the
Git & GitHub
Workshop!
Today’s agenda:
1. Git - Introduction and basic commands
by Goanta Rares
Learn how to install Git, navigate Git Bash, and use basic commands
along with creating branches and merging changes.
2. GitHub - Contribute and Collaborate
by Marinescu Teodor
Discover how to create and clone repositories, collaborate by pushing
changes, fork repositories, create pull requests, and manage contributions
from a maintainer's perspective.
3. Q&A and Networking
On Campus UNSTPB
Part 1: Git
What is Git?
● Git is officially defined as a distributed version control
system (VCS).
● It's a system that tracks changes to our project files
over time
● It is used to efficiently work together and collaborate
on team projects
How about GitHub?
● GitHub is a hosting platform for Git
repositories
● Using GitHub, we can upload a local project
repository to a remote cloud-based GitHub
Repository
● GitHub is also a popular way developers for
developers to publish their portfolio online
Useful navigation commands
in the command-line interface
● mkdir – creates directory
● touch - creates file
● cd – changes directory
● rm – removes directory
Setup instructions
● Install git on your computers. Go to
https://git-scm.com/downloads
● After installing it, start your terminal
and type the following command:
git --version
Configuring
● git config --global user.name "Your
Name"
● git config --global user.email
your@email.com
● not used to log in anywhere, used to
track who made what changes
● A Git repository is a container for a project that is tracked by Git
○ Local repository = an isolated repository stored on your own computer
○ Remote repository = generally stored outside of your isolated local system,
usually on a remote server; useful for working in teams
● Initializing a repository (git init)
○ If you want to use git to track the changes in a folder you have to initialize it first
● Checking the status (git status)
○ used to check changes and tracked/untracked files
Repositories
git add
● Adds files to the staging area, which allows git to
track those files
● syntax:
○ git add file.js – one file
○ git add file.js file2.js file3.js – multiple files
○ git add . – all the files and folders
● Checking the status (git status)
○ used to check changes and
tracked/untracked files
git commit
● Saves a snapshot of your code at a particular
time
● syntax:
○ git commit -m „Commit message”
git log
● used to see the commit history
git checkout
● Used to go to a previous state of your code that you
commited
○ syntax: git checkout <commit-hash>
○ You can see the commit hashes when you use git log
● To go back you can use:
○ git checkout master
git rebase (Teo’s favourite command)
● A more advanced command often used in professional workflows to keep commit history clean.
● Integrates changes from one branch into another while keeping a linear history
● Unlike git merge, it rewrites commit history to eliminate unnecessary merge commits.
● Use it to update your branch with the latest changes from the main branch:
git fetch origin
git rebase origin/main
● Resolve conflicts and continue with:
git rebase --continue
● Avoid rebasing public branches to prevent rewriting shared history.
● Individual timelines of our project commits, where versions of our
project code can exist and be tracked in parallel
○ git branch - lists the branches
○ git branch <new-branch-name> - creates a new branch
● Changing branches:
○ git checkout <branch-name> (hence the git checkout
master from before)
Branches
● Used to implement the code changes that you
made in an individual branch to a different
branch (usually on master)
○ syntax:
git merge <branch-name>
● Deleting branches
○ syntax:
git branch -d <branch-name>
Merging branches (git merge)
Part 2: GitHub
Step-by-step Guide to Collaboration and Advanced
GitHub Features
Create a GitHub
account if you don’t
already have one
Send us your GitHub
usernames
ⓘ
Click Present with Slido or install our Chrome extension to activate
this poll while presenting.
Step 1: Create a GitHub Repository
● Log in: Go to GitHub and log into your account.
● New Repository: Click the + icon (top-right) New repository.
→
● Name: Enter a name for your repository.
● Visibility: Choose Public (anyone can see) or Private (restricted access).
● Optional: Add a description, README, .gitignore, or license.
● Create: Click Create repository.
● Push Code (Optional): Use the commands provided to push your local
code.
Step 2: Add Collaborators
● Go to your repository → Settings
● Click Manage access → Invite a collaborator
● Enter their GitHub username or email → Add
● Collaborator accepts the invitation. Done!
Step 3: Clone the Repository
1. Copy the repository URL (HTTPS, SSH, or GitHub
CLI).
2. Open your terminal.
3. Run: git clone <repo-ulr>
4. Navigate to the cloned repository folder.
cd repo-name
Step 4: Create Your Own Branch
1. Run the command:
git branch <branch-name>
2. Switch to your branch:
git checkout <branch-name>/git switch <branch-name>
3. Verify the branch:
git branch
4. Push the branch:
git push -u origin <branch-name>
Step 5: Stash Changes
• Save your work
– git stash
• Come back later
– git stash pop
• See what’s saved
– git stash list
Step 6: Push Changes
● Create a new file and add content.
○ git add <file-name> / git add . (all)
○ git restore --staged <file-name> / .(all)
● Commit:
○ git commit -m "message"
● Push changes:
○ git push origin <branch-name>
Step 7: Pull Request and Merge
1. Go to the GitHub repository.
2. Click on 'Pull Requests' and select 'New Pull Request'.
3. Compare changes and select your branch.
4. Add a description and click 'Create Pull Request'.
5. Merge the request after review.
Step 8: Fork a Repository
1. Go to the repository you want to fork.
2. Click the 'Fork' button on the top right.
3. Choose your account to fork the repository.
4. Clone the forked repository and start
contributing.
OVERVIEW
3 scenarios
Scenario 1: Working Solo on Your Own Projects
(I really don’t know what’s wrong with the indents on these slides. They look fine on PowerPoint
and Google Slides, but they get messed up when uploaded here)
1. Create a directory on your computer:
mkdir <project-directory>
cd <project-directory>
2. Initialize a local repository:
git init
3. Create a GitHub repository and connect it as the remote origin:
git remote add origin <repo-url>
4. Make changes to your files and track them:
git add .
git commit -m "Describe changes"
5. Push changes to GitHub:
git push -u origin master
Your project is now on GitHub, and you can track its progress and share it with others if
needed.
Scenario 2: Collaborating with Friends
Repository Owner:
Add collaborators on GitHub: Navigate to Settings > Access > Collaborators > Add People
Collaborators:
Clone the repository:
git clone <repo-url>
Everyone:
Create and switch to your own branch:
git branch <branch-name>
git checkout <branch-name>
Make changes, stage, and commit:
git add .
git commit -m "Describe changes"
Push your branch to GitHub:
git push -u origin <branch-name>
Open a pull request on GitHub:
Go to Pull Requests > Compare & pull request
Select your branch to compare with the main branch.
Resolve conflicts (if any) and merge the pull request.
Useful VS Code extensions:
Git Graph: Visualize commit history
and branch structure.
GitHub Pull Requests: Manage PRs
and resolve conflicts in VS Code.
GitLens: View file history,
authorship, and commit details.
Scenario 3: Collaborating to a larger project
(where you are not collaborator)
1. Fork the repository:
Click the Fork button in the top-right corner of the repository on GitHub.
2. Clone your forked repository:
git clone <your-fork-url>
3. Create and switch to a new branch:
git branch <branch-name>
git checkout <branch-name>
4. Make changes, stage, and commit:
git add .
git commit -m "Describe changes"
5. Push changes to your fork:
git push origin <branch-name>
6. Open a pull request:
Go to the original repository on GitHub.
Navigate to Pull Requests > Compare & pull request
Select your branch from your fork and propose it for the base branch of the original repository.
*extra Teo stuff from work idk
ⓘ
Click Present with Slido or install our Chrome extension to show live
Q&A while presenting.
Q&A (we forgot to show this part)

More Related Content

Similar to Git and GitHub Workshop of GDG on Campus UNSTPB (20)

KEY
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
ODP
Git presentation
Vikas Yaligar
 
PDF
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
PPTX
Introduction to Git and Github
Max Claus Nunes
 
PDF
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PPTX
GIT & Github introduction for beginners
riteshsingh3651
 
PPT
Git is a distributed version control system .
HELLOWorld889594
 
PPT
git2.ppt
ssusered2ec2
 
PPTX
Git & GitHub 101farwsfrwvnfuvnvjvvv.pptx
sihoxe6756
 
PPTX
Hacktoberfest intro to Git and GitHub
DSC GVP
 
PPTX
GITHappens, powerpoint about git and github
alidor4702
 
PPTX
GitHub and Open Source - GDGoC MIT Anna University
mitgdsc
 
PPTX
Git Session 2K23.pptx
Eshaan35
 
PDF
Essential Git and Github commands
Isham Rashik
 
PDF
Git
Terry Wang
 
PDF
Git 入门与实践
Terry Wang
 
PPTX
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
PDF
Git 入门 与 实践
Terry Wang
 
PPTX
Git tutorial
Peder Larson
 
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
Git presentation
Vikas Yaligar
 
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
Introduction to Git and Github
Max Claus Nunes
 
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
Intro to git and git hub
Venkat Malladi
 
GIT & Github introduction for beginners
riteshsingh3651
 
Git is a distributed version control system .
HELLOWorld889594
 
git2.ppt
ssusered2ec2
 
Git & GitHub 101farwsfrwvnfuvnvjvvv.pptx
sihoxe6756
 
Hacktoberfest intro to Git and GitHub
DSC GVP
 
GITHappens, powerpoint about git and github
alidor4702
 
GitHub and Open Source - GDGoC MIT Anna University
mitgdsc
 
Git Session 2K23.pptx
Eshaan35
 
Essential Git and Github commands
Isham Rashik
 
Git 入门与实践
Terry Wang
 
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
Git 入门 与 实践
Terry Wang
 
Git tutorial
Peder Larson
 

Recently uploaded (20)

PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Ad

Git and GitHub Workshop of GDG on Campus UNSTPB

  • 1. On Campus UNSTPB Welcome to the Git & GitHub Workshop!
  • 2. Today’s agenda: 1. Git - Introduction and basic commands by Goanta Rares Learn how to install Git, navigate Git Bash, and use basic commands along with creating branches and merging changes. 2. GitHub - Contribute and Collaborate by Marinescu Teodor Discover how to create and clone repositories, collaborate by pushing changes, fork repositories, create pull requests, and manage contributions from a maintainer's perspective. 3. Q&A and Networking On Campus UNSTPB
  • 4. What is Git? ● Git is officially defined as a distributed version control system (VCS). ● It's a system that tracks changes to our project files over time ● It is used to efficiently work together and collaborate on team projects
  • 5. How about GitHub? ● GitHub is a hosting platform for Git repositories ● Using GitHub, we can upload a local project repository to a remote cloud-based GitHub Repository ● GitHub is also a popular way developers for developers to publish their portfolio online
  • 6. Useful navigation commands in the command-line interface ● mkdir – creates directory ● touch - creates file ● cd – changes directory ● rm – removes directory
  • 7. Setup instructions ● Install git on your computers. Go to https://git-scm.com/downloads ● After installing it, start your terminal and type the following command: git --version Configuring ● git config --global user.name "Your Name" ● git config --global user.email [email protected] ● not used to log in anywhere, used to track who made what changes
  • 8. ● A Git repository is a container for a project that is tracked by Git ○ Local repository = an isolated repository stored on your own computer ○ Remote repository = generally stored outside of your isolated local system, usually on a remote server; useful for working in teams ● Initializing a repository (git init) ○ If you want to use git to track the changes in a folder you have to initialize it first ● Checking the status (git status) ○ used to check changes and tracked/untracked files Repositories
  • 9. git add ● Adds files to the staging area, which allows git to track those files ● syntax: ○ git add file.js – one file ○ git add file.js file2.js file3.js – multiple files ○ git add . – all the files and folders ● Checking the status (git status) ○ used to check changes and tracked/untracked files git commit ● Saves a snapshot of your code at a particular time ● syntax: ○ git commit -m „Commit message”
  • 10. git log ● used to see the commit history git checkout ● Used to go to a previous state of your code that you commited ○ syntax: git checkout <commit-hash> ○ You can see the commit hashes when you use git log ● To go back you can use: ○ git checkout master
  • 11. git rebase (Teo’s favourite command) ● A more advanced command often used in professional workflows to keep commit history clean. ● Integrates changes from one branch into another while keeping a linear history ● Unlike git merge, it rewrites commit history to eliminate unnecessary merge commits. ● Use it to update your branch with the latest changes from the main branch: git fetch origin git rebase origin/main ● Resolve conflicts and continue with: git rebase --continue ● Avoid rebasing public branches to prevent rewriting shared history.
  • 12. ● Individual timelines of our project commits, where versions of our project code can exist and be tracked in parallel ○ git branch - lists the branches ○ git branch <new-branch-name> - creates a new branch ● Changing branches: ○ git checkout <branch-name> (hence the git checkout master from before) Branches
  • 13. ● Used to implement the code changes that you made in an individual branch to a different branch (usually on master) ○ syntax: git merge <branch-name> ● Deleting branches ○ syntax: git branch -d <branch-name> Merging branches (git merge)
  • 14. Part 2: GitHub Step-by-step Guide to Collaboration and Advanced GitHub Features
  • 15. Create a GitHub account if you don’t already have one
  • 16. Send us your GitHub usernames ⓘ Click Present with Slido or install our Chrome extension to activate this poll while presenting.
  • 17. Step 1: Create a GitHub Repository ● Log in: Go to GitHub and log into your account. ● New Repository: Click the + icon (top-right) New repository. → ● Name: Enter a name for your repository. ● Visibility: Choose Public (anyone can see) or Private (restricted access). ● Optional: Add a description, README, .gitignore, or license. ● Create: Click Create repository. ● Push Code (Optional): Use the commands provided to push your local code.
  • 18. Step 2: Add Collaborators ● Go to your repository → Settings ● Click Manage access → Invite a collaborator ● Enter their GitHub username or email → Add ● Collaborator accepts the invitation. Done!
  • 19. Step 3: Clone the Repository 1. Copy the repository URL (HTTPS, SSH, or GitHub CLI). 2. Open your terminal. 3. Run: git clone <repo-ulr> 4. Navigate to the cloned repository folder. cd repo-name
  • 20. Step 4: Create Your Own Branch 1. Run the command: git branch <branch-name> 2. Switch to your branch: git checkout <branch-name>/git switch <branch-name> 3. Verify the branch: git branch 4. Push the branch: git push -u origin <branch-name>
  • 21. Step 5: Stash Changes • Save your work – git stash • Come back later – git stash pop • See what’s saved – git stash list
  • 22. Step 6: Push Changes ● Create a new file and add content. ○ git add <file-name> / git add . (all) ○ git restore --staged <file-name> / .(all) ● Commit: ○ git commit -m "message" ● Push changes: ○ git push origin <branch-name>
  • 23. Step 7: Pull Request and Merge 1. Go to the GitHub repository. 2. Click on 'Pull Requests' and select 'New Pull Request'. 3. Compare changes and select your branch. 4. Add a description and click 'Create Pull Request'. 5. Merge the request after review.
  • 24. Step 8: Fork a Repository 1. Go to the repository you want to fork. 2. Click the 'Fork' button on the top right. 3. Choose your account to fork the repository. 4. Clone the forked repository and start contributing.
  • 26. Scenario 1: Working Solo on Your Own Projects (I really don’t know what’s wrong with the indents on these slides. They look fine on PowerPoint and Google Slides, but they get messed up when uploaded here) 1. Create a directory on your computer: mkdir <project-directory> cd <project-directory> 2. Initialize a local repository: git init 3. Create a GitHub repository and connect it as the remote origin: git remote add origin <repo-url> 4. Make changes to your files and track them: git add . git commit -m "Describe changes" 5. Push changes to GitHub: git push -u origin master Your project is now on GitHub, and you can track its progress and share it with others if needed.
  • 27. Scenario 2: Collaborating with Friends Repository Owner: Add collaborators on GitHub: Navigate to Settings > Access > Collaborators > Add People Collaborators: Clone the repository: git clone <repo-url> Everyone: Create and switch to your own branch: git branch <branch-name> git checkout <branch-name> Make changes, stage, and commit: git add . git commit -m "Describe changes" Push your branch to GitHub: git push -u origin <branch-name> Open a pull request on GitHub: Go to Pull Requests > Compare & pull request Select your branch to compare with the main branch. Resolve conflicts (if any) and merge the pull request. Useful VS Code extensions: Git Graph: Visualize commit history and branch structure. GitHub Pull Requests: Manage PRs and resolve conflicts in VS Code. GitLens: View file history, authorship, and commit details.
  • 28. Scenario 3: Collaborating to a larger project (where you are not collaborator) 1. Fork the repository: Click the Fork button in the top-right corner of the repository on GitHub. 2. Clone your forked repository: git clone <your-fork-url> 3. Create and switch to a new branch: git branch <branch-name> git checkout <branch-name> 4. Make changes, stage, and commit: git add . git commit -m "Describe changes" 5. Push changes to your fork: git push origin <branch-name> 6. Open a pull request: Go to the original repository on GitHub. Navigate to Pull Requests > Compare & pull request Select your branch from your fork and propose it for the base branch of the original repository.
  • 29. *extra Teo stuff from work idk
  • 30. ⓘ Click Present with Slido or install our Chrome extension to show live Q&A while presenting. Q&A (we forgot to show this part)

Editor's Notes

  • #16: 📣 This is Slido interaction slide, please don't delete it. ✅ Click on 'Present with Slido' and the poll will launch automatically when you get to this slide.
  • #30: 📣 This is Slido interaction slide, please don't delete it. ✅ Click on 'Present with Slido' and the questions from your audience will appear when you get to this slide.