Git, Source & Versioning
Source & Version Control
Git is what BU uses for a version control system.
The following is a simplified definition of what git is from Wikipedia:
Git is a version-control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source-code management in software development, but it can be used to keep track of changes in any set of files.
There are a two main ways to work with git:
Using Tower or SourceTree for Version Control
The most popular GUI git client used in Interactive Design is
Tower, with
Sourcetree a close second. Both are powerful programs that takes care of all the git commands under hood. For many visual-learners, this is much quicker than typing commands in the command line and executing them.
To begin using Tower, browse their Getting Started with Tower guide. They also have plenty of quick, useful YouTube videos.
To begin using SourceTree, browse their Get Started with Sourcetree guide.
Extra Reading: Avoiding Merge Commits
Pulling changes from a remote branch using git pull (or a Pull feature in Tower/SourceTree) is a git fetch followed by a git merge, creating a merge commit. For instance, pulling master changes into a behind feature branch results in a commit like Merge branch master into feature/some-cool-feature.
For GUI users, this can often be accomplished in a dialog box that appears when clicking the Pull button. For example, in Tower when clicking “Pull”, a dialog appears that confirms the branch to pull in, along with the option to check “Use Rebase Instead of Merge”. Checking this box will avoid the merge commit. Leaving the box unchecked will result in a merge commit.
Understand how to avoid merge commits by reading these: Simpler Rebasing (avoiding unintentional merge commits) and 4 Ways to Avoid Merge Commits in Git.
Using CLI for Version Control
For users who would rather execute git commands themselves in a terminal window, browse the
Getting Started Installing Git article.
If you prefer to install packages via homebrew, this can also be installed on a machine by running the brew install gitcommand.
To confirm the install was successful, run the git --version command which should print the version of git that was installed on the machine.
Extra Reading: Avoiding Merge Commits
Pulling changes from a remote branch using git pull (or a Pull feature in Tower/SourceTree) is a git fetch followed by a git merge, creating a merge commit. For instance, pulling master changes into a behind feature branch results in a commit like Merge branch master into feature/some-cool-feature.
For CLI users, these merge commits can be avoided by running the command git pull --rebase which rewinds your current changes, pulls in the remote code, and then replays your changes one-by-one on top of the incoming branch resulting in no merge commit.
Understand how to avoid merge commits by reading these: Simpler Rebasing (avoiding unintentional merge commits) and 4 Ways to Avoid Merge Commits in Git.
Version Numbering