Branches
A branch is a series of commits. Any commit resides in one (or more) branch.
Every branch has a name. The default branch is called
master
in Git.A new branch can stem from an existing branch. This is typically used to test new ideas (e.g. to try another network architecture), while the working code remains undistrupted in the original branch. This is why a branch is like a parallel universe.
Branches can be merged. Once the new idea is fully working, you can incorporate the changes back to the original branch.
Merge
There are two types of merges.
It's quite staightforward if one branch is simple ahead of another branch. This is called a fast-forward merge. Otherwise, it's a non-fast-foward merge. In this case, Git will try to combine the two versions together.
Conflits
During a non-fast-forward merge, conflicts may occur. E.g. one branch changes the batch size to 32, while the other changes it to 64. Which one should the merge use?
In this case, Git will let you determine the result. This will be done by asking you to select the change to keep.
Last updated