Introduction to GIT

Posted in GIT by

GIT is a distributed version control system. It does not depend on a server and can be used offline.

Lets get started. Linux and Mac users can download and install git the easy way. That's why we skip to windows directly. Download msysgit and install it.

Your first project

Open "git-cmd.bat". Navigate to your project folder. If you want to start a blank project:

git init

If you want to clone an existing project from githut, bitbucket or anywhere else:

git clone "https://url/to/repo.git"

Adding files to your project

Add single files, you can use wildcards:

git add *.php

Add all files in your project folder:

git add .

Commit a new version

A commit saves the current state of your project. You can always return to this state. A commit is done local at your computer. Commit often and use an expressive message.

git commit -am "my expressive message"

Pushing changes to a remote repo

When you are done with working, and did something useful, you can push your changes to the repo (if you got access). This can be done with:

git push origin master

Where to go from here?

Read our next tutorials, and some company build a search engine for finding information. Use it.

Published at , Updated at 2011-12-02

next: working with remotes