DEV Community

Discussion on: Feb. 28, 2020: What did you learn this week?

Collapse
 
deciduously profile image
Ben Lovy • Edited

This is probably embarrassing but I'm sharing anyway: I learned a GitHub fork is basically just a branch. I've always re-forked other people's repos to work on them again. Turns out, you can just rebase in your existing fork like on your own local repos:

$ git remote add upstream https://github.com/someone_elses/repository.git
$ git fetch upstream
$ git checkout master
$ git rebase upstream/master 

Done! None of these steps are new concepts for me, at all, I just never put two and two together in this context somehow. I would imagine pretty much everyone does it this way instead of the caveman-like nonsense I was up to before. Thanks, StackOverflow. Never leave me.