Git repo in shared folder or multiple cloned repos in each researcher individual folder for collaborative data analysis? We are four social scientists working on a dataset that is in a secure server accessible via remote desktop. We have a shared folder where we put our code and datasets:

root
-functions
-data
-documentation
-output


Right now all we have done is to:

git init
git add --a
git commit


At the root of our shared folder. We have also edited a .gitignore file to keep git from tracking images and non-plain text files.

This way, whenever one of us edits a file we go:

git add editedFile.r
git commit


Which can erase the changes if the previous person who edited the same file didn't stage and commit it. Not all of us are fully conversant in git and it is likely that the more skilled will have to periodically check the status of files, stage, and commit them for the ones who don't git yet.

Each of us also has our own private folder on the same servers. We potentially could have each our own local repository in our private folders, and treat the shared folder as a remote. Then we would:

git pull
git add editedFile.r
git commit
git push


As we go by our workday.

Which one would work better for the situation described: fork and pull (each one with our own repository and the shared as a remote) or all work on the same repo in the shared folder?
I pretty much agree that you've got two options:
Work as is, all in the same directory on the same system.
There are a lot of problems with this approach.

If multiple people are working at the same time modifying source files you'll step on each other's feet a lot. Two people can't edit the same file at the same time. You'll deal with annoying &quot;that file is in use by another process&quot; messages all the time.
Someone might make a change that affects the behavior of a function and it'll come as a surprise to someone else.

On the other hand, the issues you'll run into are fairly easy to recognize and plan around. If you all aren't familiar with Git, and expect to be making actual code changes fairly infrequently, the cons aren't too big of an issue.
I would avoid this at all costs. I've worked on projects before where multiple people were working on the same files in the same directory on a remote server and it's awful. Words almost cannot describe the frustration that it leads to.
Multiple versions of the repository
Set up the filesystem to look like:
user1/
--root/
----/functions
----/data
----/documentation
----/output
user2/
--root/
----/functions
----/data
----/documentation
----/output
user3/
--root/
----/functions
----/data
----/documentation
----/output
user4/
--root/
----/functions
----/data
----/documentation
----/output

Each user should have a directory that contains it's own clone of the repository. This lets you avoid stepping on each other's toes when working at the same time, and lets you emulate a &quot;normal&quot; git environment.
From there it's just business as normal, and as long as y'all can overcome the initial learning curve it'll work out much better than if you're all working in the same space.