Git workflows
If we want to work and prosper with Git, we have to firmly grasp its principles and the main workflow approaches. There is much theory and some alternatives on how we can manage our Puppet code in a safe and comfortable way using Git.
In this section, we will review:
The Git basic principles and commands
Some useful Git hooks
Code management using Git
Git is generally available as the native package in every modern OS. Once we have installed it, we can configure our name and e-mail (that will appear in all our commits) with:
git config --global user.name "Alessandro Franceschi" git config --global user.email [email protected]
These commands simply create the relevant entries in the ~/.gitconfig
file. We can add more configurations either by directly editing this file or with the git config
command, and check their current values with git config -l
.
To create a Git repository, we just have to move into the directory that we want to track and simply type git init
. This command initializes...