Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GIT: Understanding Git architecture and object ...

Pierre GOUDJO
December 30, 2021

GIT: Understanding Git architecture and object model

Explaining the architecture and object model of GIT

Pierre GOUDJO

December 30, 2021
Tweet

More Decks by Pierre GOUDJO

Other Decks in Technology

Transcript

  1. Cloning creates a remote called "origin" Remotes ~$ git clone

    http://some.repo.com someDirectory ~$ git branch -a * master remotes/origin/master
  2. Where is the remote? Remotes ~$ git remote -v origin

    http://some.repo.com (fetch) origin http://some.repo.com (push)
  3. A local branch may “track” a remote URL Remotes ~$

    git branch -vv * master b956c45 [origin/master] Initial commit some-local-branch a74b295 Implemented that cool feature
  4. Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u

    origin/new-feature ~$ git push -u origin/new-feature ~$ git checkout -b new-feature
  5. Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u

    origin/new-feature ~$ git push -u origin/new-feature ~$ git checkout -b new-feature ~$ git checkout existing-branch-on-remote
  6. Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u

    origin/new-feature ~$ git push -u origin/new-feature ~$ git branch -vv master b956c45 [origin/master] Initial commit new-feature b956c45 [origin/new-feature] Initial commit
 * existing-branch-on-remote b956c45 [origin/existing-branch-on-remote] Another commit some-local-branch a74b295 Implemented that cool feature ~$ git checkout -b new-feature ~$ git checkout existing-branch-on-remote
  7. Other Remotes Remotes ~$ git remote add another http://another.repo.fr ~$

    git remote -v origin http://some.repo.com (fetch) origin http://some.repo.com (push) another http://another.repo.fr (fetch) another http://another.repo.fr (push)
  8. The major di ff erence between Git and other VCS

    is the way they think about data
  9. CVS, SVN and others think of the information they store

    as a set of data and the changes made to each fi le over time Δ-based version control
  10. Every time you commit Git takes a picture of what

    all your fi les look like at that moment Snapshot-based version control