binghe
V2EX  ›  问与答

Linux 系统, git clone 到指定目录,如果该目录不为空,能否强制拉代码?

  •  
  •   binghe · Oct 28, 2022 · 2086 views
    This topic created in 1472 days ago, the information mentioned may be changed or developed.

    Linux

    git clone https://xxxx.xxx/xxx.git myweb
    

    如果这个“myweb”目录不是空的,能否强制把代码拉下来呢?

    Tip:

    1 、git 仓库不是我的。

    2 、myweb 目录下有多个文件以及几个.xxx 的隐藏目录,不能删。

    7 replies  •  2022-11-02 01:29:52 +08:00
    runo
    runo
    Oct 28, 2022
    1
    ysc3839
    ysc3839
    Oct 28, 2022
    2
    clone 到别的地方然后 move 过去即可
    binghe
    binghe
    OP
    Oct 28, 2022
    3
    @ysc3839 #2 目前是 mv 过去的,但是这样就无法 git pull 了
    ysc3839
    ysc3839
    Oct 28, 2022
    4
    @binghe 没有跟踪的文件应该不影响 pull 才对
    sdfh8412
    sdfh8412
    Oct 28, 2022
    5
    不能
    flyqie
    flyqie
    Oct 29, 2022 via Android
    6
    @q1angch0u #1

    楼主问的应该是 解决方法。。

    你理解错了。。
    flynaj
    flynaj
    Nov 2, 2022 via Android
    7
    原来的目录名称改成 old ,git 后 mv 进去。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1043 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 16:29 · PVG 00:29 · LAX 08:29 · JFK 11:29
    ♥ Do have faith in what you're doing.