Problem importing project into git
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
开发者_Python百科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.
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
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).
A "tarball" is a directory tree that has been tar
red , then gzip
ped.
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.
精彩评论