Essential Git for Scientists
  • Introduction
  • Basic Concepts
    • Version Control
    • Git
    • Repo
    • Commits
    • Branches
    • Remotes
    • GitHub
    • De-centralisation
    • Summary
  • Basic Operations
    • Install Git
    • Create a Repo
    • Make a Commit
    • Inspect a Previous Commit
    • Revert a Change
    • Make a Branch
    • Extend a Branch
    • Fast-forward merge
    • Resolve conflicts
  • Intermediate Concepts
    • Commits
    • Three Trees
    • Rebase
    • Fetch
    • Pull
    • Push
  • Advanced Concepts
    • Reset
    • Interactive rebase
    • Formatted patches
    • Blame
    • Stash
    • Log filter
  • Cookbook
    • Undo
    • Branches
    • Diff
    • Stash
    • Merge
    • Hooks
    • Squashing
    • Rebase
    • Interactive Rebase
    • LFS
    • Submodules
    • Remote
    • Force push
    • Identify merged branches
    • Formated patches
    • Apply patches
    • Interactive rebase
    • Squash commits
    • Pull rebase
    • Log
    • Blame
    • Biset
    • Reset
  • Exercise
    • Exercise 1
    • Exercise 2
Powered by GitBook
On this page
  1. Basic Concepts

Git

Instead of having all versions packed in one folder, it's preferable to have only one version (typically the latest version) presented in your working directory. You can jump back and forth in time to inspect previous versions when necessary. In other words, what we need is a "time machine".

Git is this time machine, that stores every key snapshot (called a commit) of your folder. Each snapshot has a and we can jump to any snapshot at our will. At its core, Git allows you to maintain the entire history of development.

Git actually offers much more. In many cases, you want to try a new idea but worry about breaking the existing code. You wish to do that in a "parallel universe", i.e. a sandbox for testing. Git allows this by using branches. This enables you to test new things in an alternative path without interrupting the original code. Once the idea is implemented and tested, you can merge all changes back to the original code base.

When your code base grows big, it's likely that other contributors are working on the project. Git has multi-user capabilities built in. This allows members to exchange code, merge new features and solve conflicts very efficiently.

And the best part is, Git is free and open source.

Tools like Git are called source code management (SCM) systems. Another similar term is version control system (VCS).

PreviousVersion ControlNextRepo

Last updated 1 year ago