将更改推送或提交到专用服务器

时间:2013-10-15 16:04:00

标签: git github ftp

我有个人项目,我在本地PC上开发它们,并在完成后通过FTP将它们上传到服务器。

我开始使用git,跟踪我改变的内容非常好。但是当我提交或推送更改时,我不想将它们推送或提交给github或类似的东西。我想将它们推送到实时服务器。哪个是我自己的专用服务器。因为当我在项目上工作时,我在我的本地PC上测试它,我相信它应该是实时的。而不是通过ftp上传我更改的文件,可以用git将它们推送到我自己的服务器中。这是媒体庙专用服务器。

我还在服务器上安装了git。我尝试先将文件推送到github,然后尝试从github克隆存储库,它只创建文件夹的副本(项目名称)。

当我尝试在我的实时服务器上使用此代码时

git clone git@github.com:username/projectname.git thewebsitedirectory.com

它说

fatal: destination path 'thewebsitedirectory.com' already exists and is not an empty directory.

因为我已经有文件了。我无法删除的文件和那些文件都在.gitignore中被忽略。 (上传的图片)

我该怎么办?或者我应该使用FTP吗?

感谢。

2 个答案:

答案 0 :(得分:0)

根据git clone文档:

   <directory>
       The name of a new directory to clone into. The "humanish" part of 
       the source repository is used if no directory is explicitly given
       (repo for /path/to/repo.git and foo for host.xz:foo/.git). Cloning
       into an existing directory is only allowed if the directory is empty.

您可能需要先检查一下,然后:How do I clone into a non-empty directory?

答案 1 :(得分:0)

我使用的是git-ftp,这正是我想要的。

感谢您的帮助。