Git reset rewrites the git history to remove commits, stages, and even working directory changes. It should not be used on a public branch such as master.
Ignoring Files with .gitignore
Files and folders can be ignored in git using the .gitignore file. This means they are never added to the staging area or repository.
Rebasing
Rebasing is an alternative way to merge two branches together. However, unlike merging, it is destructive. It rewrites the git history, with the history becoming linear. Rebasing should never be used on a master or production branch.
Git Tags
A tag is a pointer to a specific commit. In that regard it is like a branch. Unlike a branch, a tag is static – it doesn’t move when we commit changes. They are often used to tag releases.
Merging Branches
Merging is carried out when we want to combine two branches, typically a feature branch into the master branch. Git has two merging strategies, fast-forward and three-way.
Cloning Git Repositories
Git Branches
A git branch is just a named text reference to a specific commit. They allow us to work on a feature without any risk to the default (master) branch. They also allow multiple people to work independently on the project by using different branches.
Basic Git Operations
These notes cover the basic git operations. The things covered here will be used day to day. These notes use the same repository as created in low level git.
Low Level Git
Low level git commands are rarely used in the day-to-day use of git but they are a great way to introduce how git works under the hood. These notes focus on some lower level git concepts. But first, git can store many files in a repository, in fact it’s 2160 files which is obscenely large and the chances of a hash collision between files is 1/2320 which is obscenely small.
Organize Our Project
CMake Control Flow
CMake control flow consists of both if statements and for and while loops. They work as we would expect.
CMake Variables
CMake, like any other language, has variables. CMake variables are all treated as strings but they have the usual types.