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