Configuring git for local network

Asked

Viewed 356 times

1

I have a machine here at the company where the source code is, that would be our local server. We have 2 programmers, who have access to the source that shares this machine.

In the GIT settings on each machine if I want to put for example git user.name, user.email, I shouldn’t just consider the machine I’m doing this on.?

Because currently every new configuration I do always considers the latter, for example if on programmer 1’s machine I set user.name "John" and give a git config -list will appear the name as john, but on programmer 2’s machine set user.name "Mary" and then give a git config -list will display the name as Maria.

I want to know how to configure each machine as a single user, as each programmer will commit to the files they are changing.

For example if programmer 1 changes the index file, I imagine programmer 2 should not have access to the file until the change is completed and if programmer 1 gives a GIT status the file should not even appear as in change, only if programmer 2 does this, maybe you should use Briche to resolve this conflict?

  • But if "João" appears for programmer 1 and "Maria" for programmer 2, each one is already configured with its user. What if Programmer 1 edited the file index, when checking the status, the modified file should appear, but for the programmer 2, no, because the change was not uploaded to the server. In short, your problem is not clear.

  • With [tag:svn] you can lock the file until the change is completed, but it is not recommended. serio.

1 answer

2

Git is not quite as you think. It is a decentralized, non-centralized version control system, as you are apparently doing, sharing network files.

You may even have a git server on your network, but each programmer will download the server repository to your machine and work locally in isolation. At the end, send the change to the server.

Study more about the official online book available in Portuguese.

  • Aaa understood ai at the end of the change would give a push to the local server?

  • Exactly! Concepts like branch and merge are also important for more productive teamwork.

  • Excellent, thank you very much Murillo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.