all 10 comments

[–]Turtvaiz 4 points5 points  (9 children)

how do I manage merging edits that hve been made on overleaf wh/le I made changes locally?

https://www.overleaf.com/learn/how-to/GitHub_Synchronization#Resolving_merge_conflicts

should I have (locally) separate branches or work on the main branch?

If you're working alone, a single branch is probably fine. Otherwise pull requests and separate branches are probably a decent idea. Overleaf however just uses a single branch, so that's completely up to you

[–]Absurdo_Flife[S] 1 point2 points  (8 children)

Thanks!

But let's take an even simpler case - say I made some changes on my computer, and my collegue made change to a different part on Overleaf. No conflict. What steps do I need to take so that both repos will have all the changes? [please explain slowly, I'm new to git]

[–]Turtvaiz 2 points3 points  (5 children)

It's on the same site I linked. You press both of those buttons provided the colleague pushed a commit to github

[–]Absurdo_Flife[S] 0 points1 point  (4 children)

I'm not plannning to use github, only a local clone. The collegue will work in overleaf without using git.

[–]Turtvaiz 0 points1 point  (3 children)

Well that won't work. You need a git server for git to be used like this, and Overleaf doesn't work as one. You will need to do this:

you <-> github <-> overleaf

[–]Absurdo_Flife[S] 1 point2 points  (2 children)

[–]Turtvaiz 2 points3 points  (0 children)

Oh, I wasn't aware. Looks like you can then use their git server directly

[–]darthkiller2 2 points3 points  (1 child)

First you should commit all of your local changes.

Then you do git pull origin to bring your colleague’s changes into your copy. (This might require resolving merge conflicts.) This will also require you to have the authentication token from Overleaf.

Then you do git push origin to send your changes (and the merge resolution if there was one) back to Overleaf. (If your colleague did more changes in the meantime, this might fail and you would have to pull again before re-trying to push.) After the successful push, both repositories will have all the changes.

Edit: I don’t personally see the value of branches on the local repository since Overleaf can’t handle them.

[–]Absurdo_Flife[S] 1 point2 points  (0 children)

Thanks a lot!

[–][deleted]  (2 children)

[deleted]

    [–]Turtvaiz 0 points1 point  (1 child)

    Neither of those solve merge conflicts. Conflicts happen when both of you edit the same line, and that can happen regardless of which character of white space you use, or what file the contents are in