Mirror Git to Overleaf and the other way around assuming one side interaction at a time #12

Open
opened 2024-06-24 16:55:54 +02:00 by Benjamin_Loison · 7 comments

Like I prefer to work locally with Kile and Git but I share to people an Overleaf for better realtime interactivity during meetings for instance.

As it is the same Overleaf from a meeting to another a meeting member may modify the Overleaf so have to pay attention to not have conflict leading to overwriting and if there are some treat them.

Ideally would be compatible with #11 scheme.

Like I prefer to work locally with Kile and Git but I share to people an Overleaf for better realtime interactivity during meetings for instance. As it is the same Overleaf from a meeting to another a meeting member may modify the Overleaf so have to pay attention to not have conflict leading to overwriting and if there are some treat them. Ideally would be compatible with #11 scheme.
Author
Owner

Does not Git integration does that?

Does not Git integration does that?
Author
Owner

image

i: We are testing this new feature. Click to give feedback

help page:

The Overleaf Git integration allows you to clone your Overleaf project to a local repository, treating your Overleaf project as a remote repository that changes can be pushed to and pulled from.

Source: https://www.overleaf.com/learn/how-to/Git_integration_authentication_tokens

With the first option git {clone,pull,push} works fine.

![image](/attachments/beb8f770-c766-4bb7-9d6c-78ab1b946af9) *i*: *We are testing this new feature.* *Click to give feedback* *help page*: > The Overleaf Git integration allows you to clone your Overleaf project to a local repository, treating your Overleaf project as a remote repository that changes can be pushed to and pulled from. Source: https://www.overleaf.com/learn/how-to/Git_integration_authentication_tokens With the first option `git {clone,pull,push}` works fine.
177 KiB
Author
Owner
![image](/attachments/3135b2c3-f4c2-4640-baf6-e6a6aa801a15) > [our help page](https://www.overleaf.com/learn/how-to/Git_Integration) Source: https://www.overleaf.com/user/settings
128 KiB
Author
Owner

So should just investigate if the repository is the same for everyone which I believe is not and what happens if writing on both sides at the same time.

So should just investigate if the repository is the same for everyone which I believe is not and what happens if writing on both sides at the same time.
Author
Owner

If try to push new commits on modified Overleaf remote, then get:

git push
To https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git push -f
Enumerating objects: 119, done.
Counting objects: 100% (119/119), done.
Delta compression using up to 16 threads
Compressing objects: 100% (119/119), done.
Writing objects: 100% (119/119), 60.87 MiB | 10.33 MiB/s, done.
Total 119 (delta 35), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (35/35)
remote: error: forced push prohibited
remote: 
remote: hint: You can't git push --force to a Overleaf project.
remote: hint: Try to put your changes on top of the current head.
remote: hint: If everything else fails, delete and reclone your repository, make your changes, then push again.
To https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX
 ! [remote rejected] master -> master (forced push prohibited)
error: failed to push some refs to 'https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX'

This makes typo or secret leak kept forever?

If try to push new commits on modified Overleaf remote, then get: ```bash git push ``` ``` To https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. ``` ```bash git push -f ``` ``` Enumerating objects: 119, done. Counting objects: 100% (119/119), done. Delta compression using up to 16 threads Compressing objects: 100% (119/119), done. Writing objects: 100% (119/119), 60.87 MiB | 10.33 MiB/s, done. Total 119 (delta 35), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (35/35) remote: error: forced push prohibited remote: remote: hint: You can't git push --force to a Overleaf project. remote: hint: Try to put your changes on top of the current head. remote: hint: If everything else fails, delete and reclone your repository, make your changes, then push again. To https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX ! [remote rejected] master -> master (forced push prohibited) error: failed to push some refs to 'https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX' ``` This makes typo or secret leak kept forever?
Author
Owner

On Debian 12 GNOME Pegasus:

git clone https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX
Cloning into 'XXXXXXXXXXXXXXXXXXXXXXXX'...
Username for 'https://git.overleaf.com':

Same censored part as in https://www.overleaf.com/project/XXXXXXXXXXXXXXXXXXXXXXXX, so related to #28.

git clone https://git@git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX
Cloning into 'XXXXXXXXXXXXXXXXXXXXXXXX'...
Password for 'https://git@git.overleaf.com':
On Debian 12 GNOME *Pegasus*: ```bash git clone https://git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX ``` ``` Cloning into 'XXXXXXXXXXXXXXXXXXXXXXXX'... Username for 'https://git.overleaf.com': ``` Same censored part as in https://www.overleaf.com/project/XXXXXXXXXXXXXXXXXXXXXXXX, so related to #28. ```bash git clone https://git@git.overleaf.com/XXXXXXXXXXXXXXXXXXXXXXXX ``` ``` Cloning into 'XXXXXXXXXXXXXXXXXXXXXXXX'... Password for 'https://git@git.overleaf.com': ```
Author
Owner
Related to [Improve_websites_thanks_to_open_source/issues/735](https://codeberg.org/Benjamin_Loison/Improve_websites_thanks_to_open_source/issues/735).
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/overleaf#12
No description provided.