版本控制 - git 如何取代FTP 部署,fatal: destination path 'www' already exists
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-02 09:18:13
0
3
1032

远程网站,目录/home/fl/www,现在转为git取代FTP上传代码。
但 /home/fl/www 里面已经有代码了,且也没有git init 过。
运行代码 cd /home/flgit clone git@bitbucket.org/xxxx.git www,报错提示 fatal: destination path 'www' already exists and is not an empty directory.

如何才可以将 git 中的复制到 /home/fl/www ,覆盖掉

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(3)
我想大声告诉你

The most direct reason why Git replaced ftp should be its version control capability. This is a good mechanism, but using Git to deploy code is not like you have to manually pull it down on the server every time. Configure it in the correct way. Finally, you can automatically push the code to the online server after you upload it to the code base, thereby always ensuring that the code version of the server is consistent with that of your code base.
In fact, the key to this configuration is to sort out the relationship between local-code library-online service code, ssh automatic login and hook (hook) configuration of the code library. The first one has been mentioned above, ssh and hook Please configure the configuration and other related content here

某草草

First clone to the www_new folder, then name Www to www_old, and finally rename www_new to www. It’s up to you whether to delete www_old or not

黄舟

An error message indicates that your target path folder already exists.
So just go to the root directory of your website to initialize the new warehouse, and then pull the code over.

1. cd 到你的网站根目录;
2. git init //初始化新仓库
3. git remote add [<repository>] //添加远端git仓库
4. git pull deploy //拉取你的git仓库的deploy部署分支
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template