Keeping a fork up to date

前端 未结 3 1999
耶瑟儿~
耶瑟儿~ 2020-12-23 12:25

I wanted to commit somthing to a github repository, but I (obviously) didn\'t have any rights to do so. I made a fork of that repo, commited my changes and submitted a pull-

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 13:12

    I had the same problem and made a docker container that will update the forked branch I care about.

    Try using fork-sync

    The README walks you through how to configure a docker image that will clone, setup a remote to track upstream, fast forward the desired branch, and finally push the changes to your fork. The same container can be started over and over again to keep the branch up to date. I set my docker container to run on a crontab so that every two hours my workstation is updating the forks I regularly contribute to.

    I wanted to be able to make branches which tracked my fork from the tip of upstream. This could have been accomplished with git checkout -b mybranch upstream/master. But this by default sets upstream as the remote, which means if I push my branch will go to the upstream repo, and possible trigger CI jobs. Now, I can do a git checkout -b mybranch origin/master and not have to worry about a dangerous push waiting for me later.

提交回复
热议问题