Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using existing cloned repository #20

Closed
schmurfy opened this issue Nov 13, 2011 · 4 comments
Closed

Using existing cloned repository #20

schmurfy opened this issue Nov 13, 2011 · 4 comments

Comments

@schmurfy
Copy link

Hi,
I really like the idea of reusing my already cloned repository instead of cloning them again somewhere else but I was wondering how git would handle things in case of simultaneous operations, if git-dude is doing a fetch and at the same time I am doing a pull for example.

While I am pretty sure it may well never happen I would not want to corrupt a repository by accident.

Any idea if this case would be handled gracefully by git ?

@ku1ik
Copy link
Owner

ku1ik commented Nov 13, 2011

Honestly, I'm not sure. I expect that git uses some lock to prevent data corruption in such scenario but I don't know if that happens.

You'd need to do some research on that topic.

@schmurfy
Copy link
Author

Thanks for the answer, I did a quick google search but found nothing related.
I expect too that git uses some lock internally but having multiple actions acting on the same filesystem seems to be such an edge case that I am not sure it was even considered.

That said git is doing an impressive job to keep integrity, I never managed to corrupt any repositories until now.

@ku1ik
Copy link
Owner

ku1ik commented Nov 13, 2011

According to this comment http://stackoverflow.com/questions/750765/concurrency-in-a-git-repo-on-a-network-shared-folder/751026#751026 you should be rather safe.

This one http://git.661346.n2.nabble.com/concurrent-fetches-to-update-same-mirror-td5893458.html is particularly about concurrent git fetches and it seems nothing wrong should happen.

@ku1ik ku1ik closed this as completed Nov 13, 2011
@schmurfy
Copy link
Author

Nice findings, thanks for reporting them :)
Looks like it is really safe after all, i will give it a try then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants