📜  从 github fork 到 gitlab - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:11.413000             🧑  作者: Mango

代码示例1
If you just want to track changes, first make an empty repository in GitLab (or whatever else you may be using) and clone it to your computer.

Then add the GitHub project as the "upstream" remote with:

git remote add upstream https://github.com/user/repo
Now you can fetch and pull from the upstream should there be any changes. (You can also push or merge to it if you have access rights.)

git pull upstream master
Finally, push back to your own GitLab repository:

git push origin master
If you don't want to manually pull upstream/push origin, GitLab offers a mirroring ability in Settings => Repository => Mirroring repositories.