I've been using mobaXterm on a Windows 10 computer (based in Cygwin) as a terminal to access ROOT and Python scripts/macros. Additionally, my peers and I have been using Gitlab to share these scripts/macros. Recently, we begin working on a LaTeX document that has been shared also using Gitlab. The problem I've been facing is trying to integrate using Gitlab with me using Overleaf as my LaTeX editor.
I followed the guide given Here on how to link Overleaf's git repository with Github, only to run into some annoying issues.
First off, it seems as if I was able to git clone the Overleaf repository to my computer, via this line:
git clone https://git.overleaf.com/%%%%%%%%%%%%%% note_name
git remote rename origin overleaf
Then I did pull via the line
git pull overleaf master
None of this seemed to cause any problem. I then added my Gitlab repository via the line
git remote add gitlab https://gitlab.thing.ty/folder/note_name.git
Then I did a preliminary push to Gitlab via
git config --global push.default matching and
git push gitlab
Username for 'https://gitlab.thing.ty': Password for 'https://firstname.lastname@example.org': Counting objects: 21, done. Delta compression using up to 2 threads. Compressing objects: 100% (20/20), done. Writing objects: 100% (21/21), 50.81 KiB | 0 bytes/s, done. Total 21 (delta 7), reused 0 (delta 0) To https://gitlab.thing.ty/folder/note_name.git ccf7614..596ba69 master -> master`
Followed by a pull from Overleaf
git pull overleaf master
remote: Counting objects: 5, done remote: Finding sources: 100% (3/3) remote: Getting sizes: 100% (4/4) remote: Compressing objects: 100% (7764/7764) remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://git.overleaf.com/%%%%%%%%%%%% * branch master -> FETCH_HEAD f0173f3..d3bb61b master -> overleaf/master Merge made by the 'recursive' strategy. Section2.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)`
I've run into problem now when I need to commit changes and push changes to Gitlab. I get lines such as:
git commit -m "configuring git access, no major edits have been made" On branch master Your branch is ahead of 'overleaf/master' by 16 commits. (use "git push" to publish your local commits) nothing to commit, working directory clean
git push gitlab Username for 'https://gitlab.thing.ty': Password for 'https://email@example.com': To https://gitlab.thing.ty/folder/note_name.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://gitlab.thing.ty/folder/note_name.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I can't seem to figure out how to manage two different repositories at once.