W
W
wbrapist2017-08-03 00:09:15
css
wbrapist, 2017-08-03 00:09:15

How to work with the same file in Git?

Hello.
Started getting familiar with Git. Uploaded site files to the root. Let's take the same index.html.
How can we edit it together? Those. I pushed the file, the second person should do a pull, then add my code to this file and then send it to the github repository? Or are there better options? How does this all happen?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ThunderCat, 2017-08-03
@wbrapist

theoretically, 1 person works on one file, but if a difference in local / server versions pops up during an update, normal IDEs show a window with a difference, and make it possible to "merge" the files into one normal one, if it's not a battle "whose code will be the main one on the server" , then all code conflicts are resolved during the update.

P
Pazzik, 2017-12-13
@Pazzik

With the standard git console, all conflicts are resolved during merge. Everything that git can merge itself. And where there is disagreement, he makes notes in a file like this in your branch like this in the master. Then you remove the marks with your hands, and do as it should be. Save git add . You commit git commit -m "merge commit" and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question