Setting up a git repository

If I am creating a repository from scratch, then I pick the creating and commiting option.

Creating and Commiting

  • $ cd (project-directory)
  • $ git init
  • $ (add some files)
  • $ git add .
  • $ git commit -m 'Initial commit'
Once that is done, then I can clone the repository from any computer by following the Cloning and Creating Patch directions.

Cloning and Creating a Patch

  • $ git clone git://github.com/git/hello-world.git
  • $ cd hello-world
  • $ (edit files)
  • $ git add (files)
  • $ git commit -m 'Explain what I changed'
  • $ git format-patch origin/master

Pushing a branch

  • $ (execute the following in the remote repository)
  • $ git config --bool core.bare true
  • $ (delete all files in remote repository except the .git folder)
  • $ (now you can push to the remote repository from any branch)
  • $ git push origin master

Git Reference

http://git-scm.com/

Comments

Popular posts from this blog

Hacking Web App Security

Simple MVC3/Razor Fileupload and Storage

Execution is Everything : An Agile Coaching Story