1

I am new to web development. I just managed to develop an application using cakephp on shared hosting. I am trying to import the project into git. I am new to git. I have all php files. I read through the documentation on importing to git. I have successfully installed git on the local machine. And I am stuck, it says

Assume you have a tarball project.tar.gz with your initial work

I assume it is a zipped folder of the project. I have not used svn before. I have all the files in folders. Should I just zip the folders and import it.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
Ivanka
  • 11
  • 1

3 Answers3

2

If you do not have a project.tar.gz archive, simply disregard it.

Open a command prompt in the folder holding your project files. Then type

git init
git add *
git commit -m 'initial project version'

This will (line 1) initialize a Git repository in your project folder, (line 2) add/track/stage any files in the folder hierarchy and then (line 3) commit them to the repository as the initial checkin.

Check out the free eBook ProGit for additional help

Gordon
  • 312,688
  • 75
  • 539
  • 559
2

All you need to do is

  • unzip
  • go the the root of your project directory once unzipped.
  • git init .
  • git add -A
  • git commit -m "first import"

Before that first import though, you might want to add some of your files to a .gitignore file in order to not include them in the Git repository and leave them "private" (local to your view only).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    See http://stackoverflow.com/questions/640449/git-dont-show-me-pyc-in-the-list-of-untracked-files/640668#640668 for more on the `gitignore` file. – VonC Jan 13 '11 at 15:31
0

A "tarball" is a directory tree that has been tarred , then gzipped.

I think you may be overthinking this a bit though. If you already have it all sitting in directories the way you want it, then it would probably be easier to just do a git add. Perhaps make a copy of the tree and do it with that, just to prevent accidents.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134