Creating a Git repo
It's very easy to create a Git repo. Follow these steps:
- Make a directory to hold your versioned files using the following commands:
cd mkdir puppet
- Now run the following commands to turn the directory into a Git repo:
cd puppet git init Initialized empty Git repository in /home/ubuntu/puppet/.git/
Making your first commit
You can change the files in your repo as much as you like, but Git will not know about the changes until you make what's called a commit. You can think of a commit as being like a snapshot of the repo at a particular moment, but it also stores information about what changed in the repo since the previous commit. Commits are stored forever, so you will always be able to roll back the repo to the state it was in at a certain commit, or show what files were changed in a past commit and compare them to the state of the repo at any other commit.
Let's make our first commit to the new repo:
- Because Git records not only changes to the code, but also...