Table Of Contents

Previous topic

Collaboration Summary

Next topic

GitHub Repository Hosting

This Page

Workstation Configuration

Global Configuration Settings

Global configuration settings are performed once per user on a machine.

Generate Missing SSH Keys

The following command will generate missing ssh keys for a user:

if [ ! -f "~/.ssh/id_rsa" ]; then ssh-keygen -N "" -f ~/.ssh/id_rsa; fi

Create a Projects Folder

To create a projects Open a terminal prompt and type the following commands:

mkdir -p ~/Projects
cd ~/Projects

Git global settings

While there are many options for repositories, git [1] has become a de facto standard for public projects. Configure git with the following console commands:

git config --global user.name "firstname lastname"
git config --global user.email "email@domain"
git config --global branch.master.remote origin
git config --global branch.master.merge refs/heads/master
git config --global push.default matching
git config --global color.ui auto

Git global settings are recorded in home directory file ~/.gitconfig.

Configuration by Project

Development work is divided into projects which are stored locally as sub-folders of a Projects folder. Start a new project with the command:

git init ~/Projects/doc-firsttask

This creates the directory ~/Projects/doc-firsttask/.git where repository information is kept for that project.

Initialize Local Git Repo

Initialize Git repository services on a folder with the command:

git init ~/Projects/doc-firsttask

This creates the directory ~/Projects/doc-firsttask/.git where repository information is kept for that project.

Prepare .gitignore

A project will contain files with content that you create, and other files which are generated by the system. The git repository should track content and not system files. Using nano or kate, create a .gitignore file to identify untracked files to git. Here is some suggested content for .gitignore:

# ignore editor backup files
*~
*/*~
# ignore compilation from make
*build/*
*/*build/*
# ignore deployment content
*deploy/*
*/*deploy/*
# keep hidden placeholder files which preserve directories
!.gitkeep
!*/.gitkeep

Add Changes to git

Now add your changes to git [2] and view the results with the commands:

git add .
git status
git commit -m "Empty project directory for firsttask"

Footnotes

[1]For information on git, see http://en.wikipedia.org/wiki/Git_(software). A git online reference manual is at http://gitref.org/.
[2]Try GitHub offers a quick tutorial on Git and GitHub to bring you up to speed.