سؤال

I have a question about Git! Few days ago I setup a server, used for development, by 3 team members.

When they want to fix bugs, develop new features or what ever, over the existing code, they remotely (Remote Desktop) connect to the server onto their windows account and they just type code.

Later on, they perform this actions on the git bash:

> 'git status' to check the modified files
> 'git add <files they modified>' to stage the files they modified
> 'git commit -m "message about the modification"' to persist the changes

Now, my question is, since all the developers are working directly over the repository, this is, they don't have a working copy to perform posterior commits to a central repo, is this ok or am I using git the wrong way?

I ask this because, when someone modifies a file, and the other guy that is also editing the file, saves, the first to save, wins right?

The above context was just to explain my situation and some doubts, the question I really want to ask with this topic is, what should I do to configure a source control in this case?

Should each user have a working copy of the repository? Via "git clone" on the same machine?

هل كانت مفيدة؟

المحلول

The way of working for a developer would be to

  1. git clone into a local space
  2. Make changes
  3. Commit them locally
  4. Push them to the repository you created on the server.

It is always recommended for each user to have a copy of the repository and work on it(Git is a distributed VCS). git clone helps you achieve that. The location where each user needs to have his/her own repository entirely depends on how you manage your projects. It could be on the same server as the main repository or on a local storage.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top