0

I have cloned this repository from Git onto my local machine in a folder. there seem to be a lot of errors concerning build issues(deploying the application). i haven't touched the code in terms of any changes...i haven't forked anything... my question is, can i clone the repository again onto a fresh folder and start with the dependency installations again?(node, NPM, bower, gulp, etc.).... will it affect anything?

i want to make sure nothing is affected if i clone it again. the errors i get are more on the build side...like dependency errors...i want to negate all of that by starting afresh. can someone please tell me if ignoring the already cloned repository and cloning it again in a fresh folder is ok?

1
  • You can definitely clone the repo multiple times (just "git clone REPO target-dir" with different target directories), but if you haven't touched anything I don't know if it will help. Not sure what software this is, but maybe look into the autoconfig tools if you need to regenerate a makefile or something. Commented Oct 5, 2015 at 20:32

1 Answer 1

2

Yes, you can freely re-clone a Git repository in a different directory that is not a subdirectory of a current directory that contains .git. However, you don't even have to do that. If you don't care about your build products and want to remove all of them but leave original files tracked by Git untouched you can do this:

$ git clean -dxf

-dxf options mean:

-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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.