noob alert: I am learning version control and started a job in a company that uses git.
I did git clone to pull the company code base to my machine, but I pulled it into a wrong directory.
Can I delete this directory on my machine by issuing a rm -rf *
or something along those lines and redo the clone to the preferred directory?
I just want to make sure its safe to do this, I dont want to destroy the company's codebase.
Thank you in advance.
The folder is created when the project is initialized (using git init ) or cloned (using git clone ). It is located at the root of the Git project repository. If we delete the . git folder, the information saved by Git will be lost, and the directory will no longer act as a Git repository.
There's not trick in terms of how to delete a Git repo locally from your computer. You just need to delete all of the content from the folder in which the Git repo was either cloned or initialized. That's it.
The default directory for cloning should be %USERPROFILE%/Documents/GitHub #1663.
The git clone command initializes a new repository with the contents of another one and sets up tracking branches in the new repository so that you can easily coordinate changes between the two with the push/pull mechanism.
Yes, you can do that. It will only delete your local copy.
Having said that, the easier way probably will be to simply move it to the preferred location.
Each git repository is self contained and doesn't care about where it has been cloned to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With