Getting Started with Git & Creating your Repository

In order to use your git repository first you need to install Git. To install Git in Windows, read this article. In Mac OS the installation should be easy, you probably would not need to install Git at all, since it comes with Mac OS pre-installed.

In case you don't have Git installed in Mac OS, you can download git-scm downloads or use a package manager like homebrew or MacPorts.

You can also install Git from source or use package management, for instance:

yum install git-core
apt-get install git-core

Once installed, we recommend initializing Git. Fire up your command line app such as Terminal (on Mac) or Git bash (on Windows) and run the following commands.

git config --global "John Smith"
git config --global ""

Use your full name and email address, and by this you will setup Git for your purposes. You need to do this only once, the first time you install Git.

Start using Git

There are many different ways to use your Git repository. Since Git is very flexible you can start using your repository easily by importing, cloning, and many other ways.

We will show you a couple of common ways to start using your Git repository.

Starting from scratch

To start using your repository from scratch, in your command line type the following:

git clone -o beanstalk
cd gitreponame
echo "This is my new project on Beanstalk." > README
git add README
git commit -m "My first commit."
git push beanstalk master

With the commands above, you will create a folder, add a file to it, make your first commit, and push the changes to your repository, to master branch. Master branch is the default branch to use for your files.

Import existing files on your computer

To import your existing files from your local machine type the following in your command line:

cd my-project
git init
git remote add beanstalk
git add .
git commit -m "Importing my project to Git, without saving history."
git push beanstalk master

Import (clone) an existing SVN repository

In case you have used SVN repository before using Git, you would probably want to convert your repository to use it with Git. You can do this easily by typing following in command line:

git svn clone my-project
cd my-project
git remote add beanstalk
git push beanstalk master

Move an existing Git repository

In order to move an existing repository, type the following in your command line:

cd my-git-repo
git remote add beanstalk
git push beanstalk

More Git resources

To find out more about Git, read our article on getting started with Git for tutorials and books about Git.

Still need help? Contact Us Contact Us