Option A:
(选项A:)
git clone [email protected]:whatever folder-name
Ergo, for right here
use:
(Ergo,在right here
使用:)
git clone [email protected]:whatever .
Option B:
(选项B:)
Move the .git
folder, too.
(也移动.git
文件夹。)
Note that the .git
folder is hidden in most graphical file explorers, so be sure to show hidden files. (请注意, .git
文件夹在大多数图形文件浏览器中都是隐藏的,因此请确保显示隐藏的文件。)
mv /where/it/is/right/now/* /where/I/want/it/
mv /where/it/is/right/now/.* /where/I/want/it/
The first line grabs all normal files, the second line grabs dot-files.
(第一行抓取所有普通文件,第二行抓取点文件。)
It is also possibe to do it in one line by enabling dotglob (ie shopt -s dotglob
) but that is probably a bad solution if you are asking the question this answer answers. (也可以通过启用dotglob(即shopt -s dotglob
)在一行中完成此操作,但是如果您问这个答案所回答的问题,那可能是一个不好的解决方案。)
Better yet:
(更好的是:)
Keep your working copy somewhere else, and create a symbolic link.
(将工作副本保存在其他位置,并创建一个符号链接。)
Like this: (像这样:)
ln -s /where/it/is/right/now /the/path/I/want/to/use
For you case this would be something like:
(对于您而言,这类似于:)
ln -sfn /opt/projectA/prod/public /httpdocs/public
Which easily could be changed to test if you wanted it, ie:
(可以轻松更改以测试是否需要,即:)
ln -sfn /opt/projectA/test/public /httpdocs/public
without moving files around.
(无需移动文件。)
Added -fn
in case someone is copying these lines ( -f
is force, -n
avoid some often unwanted interactions with already and non-existing links). (添加了-fn
,以防有人复制这些行( -f
是强制的, -n
避免与已经存在或不存在的链接进行某些经常不必要的交互)。)
If you just want it to work, use Option A, if someone else is going to look at what you have done, use Option C.
(如果您只是想让它工作,请使用选项A;如果其他人要查看您所做的工作,请使用选项C。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…