Skip to content

Version control using Git

Learning objectives and topical outline

This class will introduce Git as a tool for versioning of code on local computer. At the of the class, participants will be able to

  • Understand the importance of versioning code
    • Describe version control
    • Provide rationale for using versioning tools
  • Describe Git
  • Know how to access Git
    • Be aware of resources that helps with Git installation on personal computer
    • Be aware of the availability of Git on Biowulf, the NIH high performance computing system
  • Define repository
  • Know the steps involved in the versioning process including
    • Initiating a new repository
    • Understanding the difference between tracked and untracked files
    • Excluding files from being tracked
    • Staging files with changes
    • Commiting changes and writing commit messages
    • Viewing commit logs
  • Compare between versions of code
  • Revert to a previous version of code

Suggestions from team

Include a cheat sheet and flow diagram of how the versioning process works with Git.

Git detached HEAD

Differentiate two files

git diff HEAD:full/path/to/foo full/path/to/bar

git diff --no-index path_to_file1 path_to_file2