SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
Git and the world of
collaborative projects
Zhixing Che
Boston University DSC
Boston University Developer Student Club
What is Git and Github?
● Git is a version control system (VCS)
○ easier to have multiple versions of code base sometimes across multiple developers
● Github is a website that hosts git repositories on a remote server
○ if git are movies, Github is like Netflix
○ the most popular git repository website, many developers’ portfolio of
choice
What is Version control?
Let’s try it out!
● Check that git is installed and that you have a github account
○ run `$ git` in terminal
○ if you don’t have it yet, you can find installation guide on git’s website
● Configure git if it is your first time using it
○ `$ git config --global user.name “firstname lastname”`
○ `$ git config --global user.name “email@email.com”`
Connect to repository hosted on Github
● Create a repository on your personal page on github
○ several options to set up your local repo for that project
■ SSH
■ HTTPS
■ Terminal commands (more on it later)
● SSH sidenote
○ It is common and recommended to configure git and github to recognize Secured
Shell (SSH) keys that you generate, so you don’t need to enter github password each
time
○ you can check so by going to https://github.com/settings/keys
Git / Github Workflow
● Open pull request on Github for preparation for merging
● Stage commits for files to be added into the repository
○ `$ git add <filename> `
○ `$ git add . `
● Commit changes and leave description
○ `$ git commit -m <message> `
● Push changes to save them
○ `$ git push origin <branch name> `
Git / Github Workflow
● Create a new branch of a project for testing out new functionalities/versions
● Resolve merge conflicts before merging
○ will be automatically checked by Github
● Merge
○ 3 types of merging
Git Branching
● View current branches
○ `$ git branch`
● Create a new branch
○ `$ git checkout -b <branch name>`
● Switch to existing branch
○ `$ git checkout <branch name>`
Merge, Squash & Merge, Rebase & Merge
● Merge vs Rebase (feature here just refers to a topic branch)
○ merge is generally easier, can done from command line
■ `git checkout feature` then `git merge feature master`
■ non-destructive operation that ties the histories of both branches. This
preserves the exact history of your project
■ may lead to muddling of the history of branch since it essentially creates
a forked history
○ rebase
■ `git checkout feature` then `git merge feature master`
■ move the entire feature branch to start from the tip of the master branch
by rewriting the project history and creating brand new commits for each
commit in the original branch.
■ singular history with no forking of commit history
■ may lose context
Lots of cool stuff on Github!
● Explore projects and fork them!
○ fork creates a copy of another repo
● Nice GUI
○ compare branches
○ make wiki for project
○ also capability to utilize github desktop and do things on GUI
■ https://guides.github.com/activities/hello-world/
■ though, command line knowledge is important for cs in college and
beyond :)
Resources & Docs
● https://git-scm.com/doc
● https://docs.github.com/
● https://guides.github.com/introduction/git-handbook/
● https://missing.csail.mit.edu/2020/version-control/
@bostonu_dsc
dsc.community.dev/boston-university/
interest form: rb.gy/orfryz
Connect with us!
fb: Boston University Developer Student Club

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git
GitGit
Git
 
Git basic
Git basicGit basic
Git basic
 
Github basics
Github basicsGithub basics
Github basics
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git training v10
Git training v10Git training v10
Git training v10
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Git basics
Git basicsGit basics
Git basics
 
git and github
git and githubgit and github
git and github
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git and Github
Git and GithubGit and Github
Git and Github
 

Semelhante a Git & GitHub WorkShop

GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
siva ram
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
Adham Saad
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
razasayed
 

Semelhante a Git & GitHub WorkShop (20)

GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
[PUBLIC] Git – Concepts and Workflows.pdf
[PUBLIC] Git – Concepts and Workflows.pdf[PUBLIC] Git – Concepts and Workflows.pdf
[PUBLIC] Git – Concepts and Workflows.pdf
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git tips
Git tipsGit tips
Git tips
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
Git & github
Git & githubGit & github
Git & github
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 

Mais de SheilaJimenezMorejon (7)

Add a backend and deploy!
Add a backend and deploy!Add a backend and deploy!
Add a backend and deploy!
 
Build a chatroom!
Build a chatroom!Build a chatroom!
Build a chatroom!
 
Introduction to Applied Machine Learning
Introduction to Applied Machine LearningIntroduction to Applied Machine Learning
Introduction to Applied Machine Learning
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Building Beautiful Flutter Apps
Building Beautiful Flutter AppsBuilding Beautiful Flutter Apps
Building Beautiful Flutter Apps
 
Information session
Information sessionInformation session
Information session
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Git & GitHub WorkShop

  • 1. Git and the world of collaborative projects Zhixing Che Boston University DSC Boston University Developer Student Club
  • 2. What is Git and Github? ● Git is a version control system (VCS) ○ easier to have multiple versions of code base sometimes across multiple developers ● Github is a website that hosts git repositories on a remote server ○ if git are movies, Github is like Netflix ○ the most popular git repository website, many developers’ portfolio of choice
  • 3. What is Version control?
  • 4. Let’s try it out! ● Check that git is installed and that you have a github account ○ run `$ git` in terminal ○ if you don’t have it yet, you can find installation guide on git’s website ● Configure git if it is your first time using it ○ `$ git config --global user.name “firstname lastname”` ○ `$ git config --global user.name “email@email.com”`
  • 5. Connect to repository hosted on Github ● Create a repository on your personal page on github ○ several options to set up your local repo for that project ■ SSH ■ HTTPS ■ Terminal commands (more on it later) ● SSH sidenote ○ It is common and recommended to configure git and github to recognize Secured Shell (SSH) keys that you generate, so you don’t need to enter github password each time ○ you can check so by going to https://github.com/settings/keys
  • 6.
  • 7. Git / Github Workflow ● Open pull request on Github for preparation for merging ● Stage commits for files to be added into the repository ○ `$ git add <filename> ` ○ `$ git add . ` ● Commit changes and leave description ○ `$ git commit -m <message> ` ● Push changes to save them ○ `$ git push origin <branch name> `
  • 8. Git / Github Workflow ● Create a new branch of a project for testing out new functionalities/versions ● Resolve merge conflicts before merging ○ will be automatically checked by Github ● Merge ○ 3 types of merging
  • 9. Git Branching ● View current branches ○ `$ git branch` ● Create a new branch ○ `$ git checkout -b <branch name>` ● Switch to existing branch ○ `$ git checkout <branch name>`
  • 10. Merge, Squash & Merge, Rebase & Merge ● Merge vs Rebase (feature here just refers to a topic branch) ○ merge is generally easier, can done from command line ■ `git checkout feature` then `git merge feature master` ■ non-destructive operation that ties the histories of both branches. This preserves the exact history of your project ■ may lead to muddling of the history of branch since it essentially creates a forked history ○ rebase ■ `git checkout feature` then `git merge feature master` ■ move the entire feature branch to start from the tip of the master branch by rewriting the project history and creating brand new commits for each commit in the original branch. ■ singular history with no forking of commit history ■ may lose context
  • 11. Lots of cool stuff on Github! ● Explore projects and fork them! ○ fork creates a copy of another repo ● Nice GUI ○ compare branches ○ make wiki for project ○ also capability to utilize github desktop and do things on GUI ■ https://guides.github.com/activities/hello-world/ ■ though, command line knowledge is important for cs in college and beyond :)
  • 12. Resources & Docs ● https://git-scm.com/doc ● https://docs.github.com/ ● https://guides.github.com/introduction/git-handbook/ ● https://missing.csail.mit.edu/2020/version-control/
  • 13. @bostonu_dsc dsc.community.dev/boston-university/ interest form: rb.gy/orfryz Connect with us! fb: Boston University Developer Student Club