6g54: | Forking Go Code
https://github.com/owasp-amass/amass/blob/master/CONTRIBUTING.md#forking
Saved on 2023-08-11 [19580 edays] via github.com
Modified 2023-08-11 [19580 edays]
git golang programming

A guide for effectively forking golang projects:

Forking

Please note that Go requires code to live under absolute paths, which complicates forking. While the fork for user 'foo' lives at https://github.com/foo/amass, the code should never exist at $GOPATH/src/github.com/foo/amass. Instead, we use git remote to add the fork as a new remote for the original repo, $GOPATH/src/github.com/owasp-amass/amass, and do all the work there.

For instance, to create a fork and work on a branch of it, user 'foo' would:

  • Create the fork on github, using the fork button.
  • Go to the original repo checked out locally (ie. $GOPATH/src/github.com/owasp-amass/amass)
  • git remote rename origin upstream
  • git remote add origin git@github.com:foo/amass.git

Now origin refers to the foo fork and upstream refers to the OWASP version. So foo can git push -u origin master to update his/her fork, and make pull requests to OWASP from there. Of course, replace foo with your git handle.

To pull in updates from the original repo, run

* `git fetch upstream`
* `git rebase upstream/master` (or whatever branch you want)

Please don't make Pull Requests to master.