Git is a distributed version control system. If you would like to read more about git there are many good online resources, a few of which are listed below.
- Pro Git Book
- GitHub Interactive Git Tutorial
- [Introduction to Git with Scott Chacon] (https://www.youtube.com/watch?v=ZDR433b0HJY)
- Git Learning Videos
- Git Reference Documentation
- Developer Workflow - Diagram of Workflow
- Documenting an Application Release in Git
- Documenting a Hotfix Release in Git
Git supports multiple platforms. Downloads and be found from the official website.
On each new system you use/install git you will want to set your personal author information. You can do so by running the following commands replacing the generic name and email information with your own.
git config --global user.name "Firstname Lastname"
git config --global user.email "your.email@bellevuecollege.edu"
We use Tim Pope's recommended "50/72 style" for commit messages.
The blog post is fairly informative but the highlights are:
- Commit messages should be written in the imperative: "Fix bug" and not "Fixed bug"
- First line of your commit message should be treated as a subject line
- Subject lines are mandatory for commit messages
- Subject lines should be no longer than 50 characters
- Subject lines should capitalized as if they were titles
- Second line of your commit message should be a single new line character
- The third line of your commit message should be treated as the commit message
body
- Commit message bodies are optional for commit messages
- Commit message body lines should not exceed 72 characters
- To add some excitement to your commit messages, you can use Emoji Log style commits 🚀.
All Git repositories should have the following branch at minimum:
- trunk - should ALWAYS match what is in production
Currently many repositories use a 'Master' and 'Dev' branch system instead of 'Trunk' and 'Dev'. The Trunk terminology was decided on to fit with the tree imagery present in Git. GitHub is moving defaults to 'Main', but using 'Trunk' should not cause conflict.
When you update an application, please update branch names if possible. Directions on updating the Master branch name.
Currently many responsitories still use the 'git flow' based workflow, which depends on a Dev and Trunk branch instead of using a pull-request based workflow. It is recommended to switch over to the GitHub Flow + Releases workflow instead.
We use one repository host:
While comfort with the command line is essential for git, there are some useful GUI applications that allow for easier visualization of branches and changes.
- GitHub Application - Cross Platform, GitHub Focused
- GitX-dev - OSX Client
- Visual Studio Code has a great built in mergetool to assist with conflicts
- If you use VS Code, GitLens offers a ton of useful tools.