I want to extend a library, available on github to add some features I need. Of course I will made available the new source code as well. Because it's the first time I do this, I'm not sure how to do.

My idea:

  1. fork the original repository
  2. create a new branch
  3. make the changes
  4. commit them locally
  5. push the new branch on another (mine) repository (of course, to avoid messing up the original one)

Is it correct? How to test the library while developing it? I mean, in which folder I have to clone the repo?

1 Answer 1



  1. Fork the library to your account
  2. Check out your fork
  3. Edit as needed
  4. Commit locally
  5. Push back to your fork

Your fork is yours to do with as you wish. Github makes it easy, should you wish, to then pass those changes back up to the original repository (make a "pull request"). But you don't have to do that (and probably don't want to).

You can make a new branch if you like, but that's pointless - your fork is, in effect, a branch itself (well, it's an entire new tree really).

  • 2
    If he plans to make a pull request, then creating a new branch will make things easier. Jan 16, 2020 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.