Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 将更改推送或提交到专用服务器_Git_Github_Ftp - Fatal编程技术网

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

Git 将更改推送或提交到专用服务器,git,github,ftp,Git,Github,Ftp,我有个人项目,我在本地电脑上开发它们,完成后通过FTP上传到服务器 我开始使用git,跟踪我所做的更改对我来说非常好。但当我提交或推送更改时,我不想将它们推送或提交到github或类似的东西。我想把它们推到实时服务器上。这是我自己的专用服务器。因为当我在这个项目上工作的时候,我在我当地的电脑上测试它,我相信它应该是实时的。不用通过ftp上传我更改的文件,而是可以用git将它们推送到我自己的服务器上。这是媒体神庙专用服务器 我还将git安装到服务器中。我首先尝试将文件推送到github,然后尝试从

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

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

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

当我尝试在live server上使用此代码时

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


谢谢。

根据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.

要克隆到的新目录的名称。“人性化”的部分
如果没有明确给出目录,则使用源存储库
(repo用于/path/to/repo.git,foo用于host.xz:foo/.git)。克隆
仅当目录为空时,才允许插入现有目录。
您可能需要检查这个选项:

我使用的正是我想要的

谢谢你的帮助