[ English | Indonesia | 한국어 (대한민국) | español (México) | English (United Kingdom) | Deutsch | 中文 (简体, 中国) ]
Setup and Learn GIT¶
Note
This section assumes you have completed Account Setup guide.
GIT¶
What is Git?¶
Git is a free and open source distributed version control system that the OpenStack community uses to manage changes to source code and documentation.
Git allows you to:
Push and test code, docs, infrastructure changes, and CI configurations
Push Specifications
Installation¶
Mac OS¶
Go to the Git download page and click Mac OS X.
The downloaded file should be a dmg in your downloads folder. Open that dmg file and follow the instructions on screen.
If you use the package manager Homebrew, open a terminal and type:
brew install git
Linux¶
For distributions like Debian, Ubuntu, or Mint open a terminal and type:
sudo apt install git
For distributions like RedHat, Fedora or CentOS open a terminal and type:
sudo dnf install git
For SUSE distributions open a terminal and type:
sudo zypper in git
Windows¶
Windows Subsystem for Linux (WSL) is available in Windows 10 Anniversary Update or later (build 1607+). There is the possibility to install and run modern Linux Operating Systems:
All common tools like bash, git, and SSH will work out of the box.
Although Git download page provides Windows installation binary, most OpenStack development tools (e.g., git-review) unfortunately will not work well on Windows environment.
Configure Git¶
Once you have Git installed you need to configure it. Open your terminal application and issue the following commands putting in your first/last name and email address. This is how your contributions will be identified:
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email@youremail.com"
Note
Use the same email address that was used during the account setup.
Learning Git¶
You can use Git Immersion to work through tutorials for learning git.
For reference, use the Git Reference and Cheat Sheet.
Commit Messages¶
Commit messsages are the first things a reviewer sees and are used as descriptions in the git log. They provide a description of the history of changes in a repository. Commit messages cannot be modified once the patch is merged.
Format:
Summary Line
Empty line
Body
Empty line
Footers
Note
Footers should be entered one per line with no empty lines between them.
Summary Line¶
The summary line briefly describes the patch content. The character limit is 50 characters. The summary line should not end with a period. If the change is not finished at the time of the commit, start the commit message with WIP.
Body¶
The body contains the explanation of the issue being solved and why it should be fixed, the description of the solution, and additional optional information on how it improves the code structure, or references to other relevant patches, for example. The lines are limited to 72 characters. The body should contain all the important information related to the problem, without assuming that the reader understands the source of the problem or has access to external sites.