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.

6
  • 2
    Where does SVN enter the picture?
    – Artefacto
    Commented Jan 13, 2011 at 15:17
  • 1
    Where does PHP enter the picture, this is very git specific. Commented Jan 13, 2011 at 15:21
  • @artefacto I thought I mention I haven't used SVN, because most of the blogs I read have compared with subversion, mercurial and many others, I have not used any of these.
    – Ivanka
    Commented Jan 13, 2011 at 15:24
  • @geoffery forgive me for being a noob, I mentioned php as app was built using php.
    – Ivanka
    Commented Jan 13, 2011 at 15:25
  • Do you actually need to compress the project? Git doesn't require this, though the server admins may. You can just go to the root folder of the project and git add, then git commit it.
    – DivinusVox
    Commented Jan 13, 2011 at 15:29

3 Answers 3

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

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).

1
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.