Krum110487
Krum110487

Reputation: 641

Repository and Binary file work flow

Ok, so this is an edge case, I am looking to use a repository for shared edited files. The problem I am having is that, while text files, we cannot merge them due to a dumb fingerprint protection which would not allow the file to be opened if we were to merge things.

so we plan on treating it as a binary file.

Our plan is that whenever someone wanted to work on the files they would have to "check-out" the files to make sure no one else is going to edit the files and waste their time since they might have to re-do the changes that someone else had.

Is there a way we can use a repository like GIT to force all files as read-only until they are checked out, or warn the user that the file is checked out and that any changes would need to be re-done?

What work flow would you use for something like this, I would like a more automated process instead of just asking people to "check-out" a file to lock it, even then the local files of people who haven't checked if it were locked could be wasting their time.

Upvotes: 0

Views: 121

Answers (1)

CodeWizard
CodeWizard

Reputation: 141946

Is there a way we can use a repository like GIT to force all files as read-only until they are checked out

The simple answer is no. Git does not have any lock mechanism. Its the opposite, you can keep working locally without even knowing that someone else is editing the same file.

What you can so is to write a script that user will invoke it and it will do what ever you want on your server side.

Unfortunately git does not support such a thing, its agains the concept beyhond git.

Here is a similar question asking more or less the same thing

Is there a way to lock individual files or directories on fork when using github?

Upvotes: 1

Related Questions