We are 2 developers who want to collaborate on some of our small projetcs, we are using Git in order to do this.
We are using a client called SourceTree which replaces the need of using commands for Git.
The question: What happens if we push our changes at the same time? We would like to avoid overwriting each others changes if possible.
Thank you for reading, and hopefully being able to answer my question.
By default, you will not overwrite the other developer's code when pushing at the same time, unless you're using --force
option.
As you're using SourceTree --force
option is disabled by default. You can enable it by checking: General > Allow force push (not recommended for you)
Another thing to do to avoid this situation, is to always git pull
before you git push
.