'Any way to know if another developer is editing the same files?

I am working with my teammates on the same WordPress project, but once in a while we face overriding each other's codes, mainly in functions.php or style.css files. I was wondering if there is any away to avoid such problems?



Solution 1:[1]

once a while we face overriding our codes by each other

When we fix or add something we may not like to first ask about 2 minutes for something that is done in just 5 minutes. But this gets a problem when multiple persons may work on same file and do not communicate about their work.

Is there a way to know if someone else is editing same functions

You can use any of below ways:

  • Recommended: use any sub-version control system like Git or SVN, and work only on your own branch (i.e. create a branch even for a single method/function and merge latter, but you also need to communicate about like: will create a branch and work on ...).

  • You could use an IDE that has a plugin that adds the feature to show other developers actions (e.g. a separate text-cursor with remote-Developer's name above it, like "Google documents").

    For example, VS Code has the so-called "Live share" extension:
    https://code.visualstudio.com/learn/collaboration/live-share

    Or, develop a plugin that does add such feature to your IDE, as most IDE's provide SDK.

  • Actively use communication method's in an advanced way (e.g. like working on exactly some file over LAN, some software do support that).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1