Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hugo Buddelmeijer
gitremotesync
Commits
a261f3f6
Commit
a261f3f6
authored
Jun 29, 2020
by
Hugo Buddelmeijer
Browse files
Improve instructions
parent
e5201646
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a261f3f6
# gitremotesync
# gitremotesync
Sync the master branches of the local repository and all remotes.
Sync the master branches of the local repository and all remotes.
\ No newline at end of file
E.g. running this in a git repository with these remotes, will synchronize
three repositories:
```
shell script
$ git remote -v
github git@github.com:hugobuddel/testlatex2.git (fetch)
github git@github.com:hugobuddel/testlatex2.git (push)
gitlab git@gitlab.astro-wise.org:buddel/testlatex2.git (fetch)
gitlab git@gitlab.astro-wise.org:buddel/testlatex2.git (push)
overleaf https://git.overleaf.com/5ef9e60ebb7def000199c1c5 (fetch)
overleaf https://git.overleaf.com/5ef9e60ebb7def000199c1c5 (push)
```
These projects will be synchronized:
*
https://www.overleaf.com/project/5ef9e60ebb7def000199c1c5
*
https://gitlab.astro-wise.org/buddel/testlatex2
*
https://github.com/hugobuddel/testlatex2
Any change to master of one of these projects will propagate to the others.
This will allow seamless collaboration through overleaf, github and/or gitlab.
Collaborators who prefer to use merge/pull requests can do so through gitlab
or github. These changes will seem like an extremely fast typer to the
collaborators that are using overleaf. Vice versa, overleaf users appear
as people who create many commits to the gitlab/github users.
To run this script, clone one of the repositories,
add the other remotes, then run the script.
```
shell script
git clone git@gitlab.astro-wise.org:buddel/gitremotesync.git
git clone git@gitlab.astro-wise.org:buddel/testlatex2.git
cd testlatex2
git init
git remote rename origin gitlab
git remote add overleaf https://git.overleaf.com/5ef9e60ebb7def000199c1c5
git remote add github git@github.com:hugobuddel/testlatex2.git
bash ../gitremotesync/synchronize.sh
```
Two things that you need to do that are beyond the scope of this project:
*
Cache your overleaf credentials, it is not possible to use SSH for overleaf.
*
Run the script periodically, e.g. every minute or before and after each change
you want to make.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment