Forum breadcrumbs - You are here:Tracston Community Forum - DevOps, Micro Services, Cloud, Infrastructure, Development, Monitoring and more...Development: GIT - Code RepositoryRemove .git directories from clon …
You need to log in to create posts and topics.
Remove .git directories from cloned branch
moshe@moshe
#1 · 23/10/2020, 2:44 pm
Quote from moshe on 23/10/2020, 2:44 pmProblem
User cloned repository from remote git and now wants to add directories to local git. it will report error that git repo already exists
Solution
Remove all .git directories before adding new git repo information
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
Problem
User cloned repository from remote git and now wants to add directories to local git. it will report error that git repo already exists
Solution
Remove all .git directories before adding new git repo information
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
Click for thumbs down.0Click for thumbs up.0