Using other repos

Introduction to GitHub Concepts

Jasmin Ludolf

Content Developer, DataCamp

Cloning

  • Similar to copy-paste
  • Linked to the original repo
  • Creates a copy on a local computer
  • Allows updates to go back and forth

How does it work?

  • With Git:
    • Push changes back to the original repo
    • Pull changes into our local version

Illustration of two arrows moving in a cycle to imply the push pull worklfow

Introduction to GitHub Concepts

Clone a repo

Screenshot of the main view of the private repo for bank marketing owned by George Boorman

Introduction to GitHub Concepts

Clone a repo

View of the bank marketing repo with a green circle around the Code button and an arrow pointing towards it.

Introduction to GitHub Concepts

Clone a repo

View of the dropdown menu after clicking the Code button on a GitHub repo.

Introduction to GitHub Concepts

Clone a repo

View of the dropdown menu after clicking the Code button on a GitHub repo and the copy icon is highlighted.

Introduction to GitHub Concepts

Clone a repo

$ pwd
/home/jasmin/bank_project

$ git clone https://github.com/george-boorman/bank_marketing.git
  • May need to input GitHub logins here
> Cloning into `bank_project`...
> remote: Counting objects: 10, done.
> remote: Compressing objects: 100% (8/8), done.
> remove: Total 10 (delta 1), reused 10 (delta 1)
> Unpacking objects: 100% (10/10), done.
Introduction to GitHub Concepts

Clone an empty repo

View of an empty repository and where to get the clone link

Introduction to GitHub Concepts

Forking

  Illustration of two sheep that are identical but separate.

  • Copy without a link to the original repo
  • Forking creates an independent copy
  • Good to run experiments without risk
  • Used for collaboration
  • Anyone can fork a public repo
  • The owner of a private repo should configure their settings
  • Submit changes with a pull request
  • Different to creating a new branch where we need to be a collaborator
1 iStock Credit:Anton Shaparenko Stock illustration ID:1158104118
Introduction to GitHub Concepts

Fork a repo

Screenshot of the main view of the private repo for bank marketing owned by George Boorman

Introduction to GitHub Concepts

Fork a repo

Screenshot of the main view of the private repo for bank marketing owned by George Boorman and the fork button is highlighted

Introduction to GitHub Concepts

Fork a repo

Screenshot of the main view of the private repo for bank marketing owned by George Boorman with the dropdown menu from the fork button visible and the Create new fork button highlighted

Introduction to GitHub Concepts

Fork a repo

View of the create new fork page

Introduction to GitHub Concepts

Fork a repo

Animated image showing the name of the forked repo being changed from bank marketing to bank marketing jasmin.

Introduction to GitHub Concepts

Fork a repo

View of the create new fork page with the branch section highlighted

Introduction to GitHub Concepts

Fork a repo

View of the create new fork page with the Create fork button highlighted

Introduction to GitHub Concepts

Fork a repo

View of the forked repository

Introduction to GitHub Concepts

Clone vs. Fork

  Illustration of two arrows moving in a cycle to imply the push pull worklfow

  Cloning

  • Creates a linked copy on a local computer
  • Requires use of Git
  • Push and pull updates with Git
  • Great for collaboration

Illustration of two sheep that are identical but separate.

Forking

  • Creates an independent copy on GitHub
  • Can all be done within GitHub
  • Submit changes through a PR
  • Great for collaboration and experimenting
Introduction to GitHub Concepts

Let's practice!

Introduction to GitHub Concepts

Preparing Video For Download...