Setting up a Github project

So I felt like setting up Github repository for awaseroot. Git is a version control system and with Github you can share your git project/repository online. We use Github as a place to share all our awaseroot material. There’s many good tutorials available (for example: but here’s the steps I took one by one. Replace awaseroot with whatever you want.

Ubuntu 12.04
Git version

The goal is to publish this:

Like this:

First. Create an account to Github:

Create a new repository:
Repository name: awaseroot
Initialize this repository with a README
-> Create repository

Install git:
sudo apt-get -y install git

Configure git:
git config --global "Firstname Lastname"
git config --global
Use the same email you used when creating the github account.

We need SSH key for the Github:
copy contents of ~/.ssh/
Or if you don’t have the key yet, create it with this first:

Log in to
Account settings -> SSH keys
-> Add SSH key
paste the contents of the ~/.ssh/

Connect to github to authenticate:
ssh -T

Clone the created Github repository:
git clone
cd awaseroot

Add the github repository as a remote git:
git remote add awase
(You can change awase to whatever you want.)

Create/add content to your project and push it to github:
cp -r ~/puppet/ ~/awaseroot/
git add puppet
git commit -m "First Puppet files added"
git push awase master

Your new pushed material should be now available in your github.

Becoming a collaborator to an existing github repository

So you have your git already configured, Github account ready with SSH key and now someone adds you as a collaborator. Here’s what to do:

If the repository is for example
Clone the repository:
git clone

You should now have the awaseroot directory. Go there:
cd awaseroot/

Add the repository as a remote:
git remote add awase

Add your files if you have something to add:
cp ~/puppet/manifests/site.pp ~/awaseroot/puppet/manifests/
git add puppet/manifests/site.pp

Commit and push your changes:
git commit -m "site.pp added"
git push awase master

Everyday use

Every time you make changes to your repository you can use these commands to commit changes:
git add my_file         # add a file called my_file to git.
git add .                   # add all modified files to git and remove deleted files.
git commit -m "commit description"  # commit changes.
git push awase master  # push changes to remote git (github).
(change awase with whatever you defined as a remote)

If someone else has made changes to your git repository, pull the changes with this:
git pull awase master

You’ll get an error message if there’s new changes in your git and you try to commit before pulling
those changes.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: