One of my other machine is cloning a repo on my host machine, and I want to multitasking by making changes on the host repo.
Is this going to be safe?
Yes, cloning a repository doesn't look at the working copy at all. Otherwise bare repositories could not be cloned.
Even if you make changes to the actual repository with operations like commit or reset, it is still safe. The clone might be slightly out of date when it completes, but that's no different than if you made the changes right after the clone completed.
Cloning is a read only operation on the repo you are cloning. So there is no danger. Further, the operations are very atomic in git and always backed by SHA1 integrity checks. So if the clone is grabbing a reference and the reference changes during the clone, the clone will continue with the value it grabbed initially. To understand this more, google "directed acyclic graph" to see how this works. Simplicity of the structure is what makes Git as successful as it is.
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