2015-10-05 180 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.