DEV Community

Cover image for Working with forks in Go

Working with forks in Go

Charles Francoise on January 09, 2018

Proper use of forks Have you ever wanted to create a fork of a Go package you're using? Maybe you need to add a feature, specific to y...
Collapse
 
canercidam profile image
Caner Çıdam

Nice approach! This also works fine for me if the package is not something to be imported by another package (i.e. a final product):

$ cd $GOPATH/src/github.com/username
$ git clone https://github.com/username/repo && cd repo
$ git remote add upstream https://github.com/original/repo
$ cd .. && cd .. && mkdir original
$ mv username/repo original/repo
Collapse
 
orkunkl profile image
Orkun Külçe

Thanks for your solution. I had to fetch before setting the upstream branch.

git fetch --all