GO is written in Go. If you don't have a Go development environment, please set one up.
The version of GO should be 1.11 or above.
After installation, you'll need GOPATH
defined,
and PATH
modified to access your Go binaries.
A common setup is the following but you could always google a setup for your own flavor.
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
- Visit https://github.com/go-jvm/gojvm
- Click
Fork
button (top right) to establish a cloud-based fork.
Define a local working directory:
# If your GOPATH has multiple paths, pick
# just one and use it instead of $GOPATH here.
working_dir=$GOPATH/src/github.com/gojvm
Create your clone:
mkdir -p $working_dir
cd $working_dir
git clone https://github.com/$user/gojvm.git
# the following is recommended
# or: git clone git@github.com:$user/gojvm.git
cd $working_dir/gojvm
git remote add upstream https://github.com/go-jvm/gojvm.git
# or: git remote add upstream git@github.com:go-jvm/gojvm.git
# Never push to upstream master since you do not have write access.
git remote set-url --push upstream no_push
# Confirm that your remotes make sense:
# It should look like:
# origin git@github.com:$(user)/gojvm.git (fetch)
# origin git@github.com:$(user)/gojvm.git (push)
# upstream https://github.com/go-jvm/gojvm.git (fetch)
# upstream no_push (push)
git remote -v
Get your local master up to date:
cd $working_dir/gojvm
git fetch upstream
git checkout master
git rebase upstream/master
Branch from master:
git checkout -b myfeature
# While on your myfeature branch.
git fetch upstream
git rebase upstream/master
Commit your changes.
git commit
When ready to review (or just to establish an offsite backup or your work),
push your branch to your fork on github.com
:
git push -f origin myfeature
- Visit your fork at https://github.com/$user/gojvm (replace
$user
obviously). - Click the
Compare & pull request
button next to yourmyfeature
branch.