2015-10-05 106 views
0

我已經將該存儲庫從Git克隆到本地計算機的文件夾中。關於構建問題似乎存在很多錯誤(部署應用程序)。我沒有觸及任何變化的代碼...我沒有分叉任何東西...我的問題是,我可以克隆再次到一個新的文件夾的存儲庫,並再次依賴安裝開始?(節點, NPM,涼亭,吞嚥等)...... 它會影響什麼?從Git多次克隆

我想確保沒有影響,如果我再次克隆它。我得到的錯誤更多的是在構建方面......像依賴錯誤......我想通過重新開始否定所有這些。 有人可以告訴我,如果忽略已經克隆的存儲庫,並在新文件夾中再次克隆它可以嗎?

+0

你絕對可以克隆repo多次(不同目標目錄中的「git clone REPO target-dir」),但如果你沒有觸及任何東西,我不知道它是否會有所幫助。不知道這是什麼軟件,但是如果你需要重新生成一個makefile或者其他東西,可以查看自動配置工具。 – neocpp

回答

2

是的,你可以自由地重新克隆一個Git庫在不同的目錄是包含.git當前目錄的子目錄。但是,你甚至不需要那樣做。如果你不關心你的構建產品和想Git不變,你可以這樣做是爲了將它們全部刪除,但離開跟蹤原始文件:

$ git clean -dxf 

-dxf選項的含義:

-d Remove untracked directories in addition to untracked files. If an 
    untracked directory is managed by a different git repository, it 
    is not removed by default. Use -f option twice if you really want 
    to remove such a directory. 

-x Don't use the standard ignore rules read from .gitignore (per 
    directory) and $GIT_DIR/info/exclude, but do still use the ignore 
    rules given with -e options. This allows removing all untracked 
    files, including build products. This can be used (possibly in 
    conjunction with git reset) to create a pristine working directory 
    to test a clean build. 

-f, --force If the git configuration variable clean.requireForce is 
    not set to false, git clean will refuse to run unless given -f or 
    -n.