-
Notifications
You must be signed in to change notification settings - Fork 445
Contribution Process
Baohua Yang edited this page Sep 17, 2022
·
20 revisions
On Linux, you can use
sudo apt-get update
sudo apt-get install git -y
# Configure the username, replace First Last:
git config --global user.name "First Last"
#Configure the email, replace example@example.com:
git config --global user.email "example@example.com"
On macOS, you can use
$ brew install hub
On Linux, you can use
sudo snap install hub --classic
hub
requires git
, and can replace its commands for most cases.
$ hub clone https://github.com/hyperledger/cello.git
$ cd cello
$ hub fork --remote-name=origin
$ git branch main --set-upstream-to origin/main
If ask for the github password, provide the access token as password. Now there will be a cello
repo under your own github account.
Check the .git/config file, there will be two remotes:
-
origin
: Your own repo, and themain
branch will track it; -
upstream
: The officialhyperledger/cello
repo.
You only need to do this forking once.
Sync your repo with the official one.
Checkout a new feature branch, commit the code change and push to your repo. Suppose your issue number is xxx
.
$ git fetch upstream main && git rebase FETCH_HEAD && git push -f origin
$ hub checkout -b issue-xxx
$ # do the code change at fix_bug branch
$ hub commit -a -s
$ make check # checking code format
$ hub push --set-upstream origin issue-xxx
Commit message policy
[#issue-no] Short Title
Detailed Commit Message
Close #issue-no
And if you want to auto close related issue, can see the closing-issues-using-keywords.
$ hub pull-request [-b upstream:main] [-r <REVIEWERS> ]
After review an approved, you can delete the issue branch.
$ git fetch upstream main && git rebase FETCH_HEAD && git push -f origin
$ git push -d origin issue-xxx
$ git branch -d issue-xxx