Git: notes on the Git repository system:


From link


Starting a Project with GIT

Here's how you start a project with GIT.
First, if you have not already done so, set yourself up to use GIT:


<span style="color: #3131aa; font-family: monospace,Courier,monospace; font-size: 12px;">git config --global user.name "My Name"
git config --global user.email me@mydomain.com
git config --global color.diff auto git config --global color.status auto
git config --global color.branch auto</span>
Now, export your project from whatever source code repository you used to use (you were already using a source code management system, right?):
NOTE! Use your source code management software's export utility to export your source code without your source code management software's special directories. Both CVS and Subversion litter your source code with CVS/ and .svn/ files respectively. You don't want to check those in to your fresh GIT repository!

<span style="color: #3131aa; font-family: monospace,Courier,monospace; font-size: 12px;">cd ~/workspace
svn export https://www.mydomain.com:5001/myproject/trunk ./myproject</span>
Now, import your project into GIT, like so:
<span style="color: #3131aa; font-family: monospace,Courier,monospace; font-size: 12px;">cd myproject
git init
git add .
git commit</span>
Of course, you want to share with your friends by setting up a bare remote repository. The easiest way is to have a shared machine where you and your friends all have ssh accounts. In all of your home directories, you have a directory called shared/ which is readable/writeable by everyone in your group. You all keep your shared bare git repositories in your shared/ directories on your remote machine, and life is good.
Continuing from where we left off, here's how you set up your bare repository:

<span style="color: #3131aa; font-family: monospace,Courier,monospace; font-size: 12px;">cd .. # this is important; you must be outside your project dir
git clone --bare ./myproject myproject.git
scp -r myproject.git mydomain.com:shared</span>
Now you can do nightly pushes to your bare git repository (can you say "easy backup"?) and your friends can pull your work.
The last step is to add a shortcut to your ~/.gitconfig file so that pushes require less typing. Here is the entire ~/.gitconfig file as it would look after the git configs we did at the start, and after adding, using a text editor, a shortcut to your new bare remote repository:

 
 
Happy gitting!