From the Github interface, click on the fork button
Verify that your user name and email in your local git environment match what you have in Github
git config user.name
git config user.email
You can set these variables with the following
git config user.email "email@example.com"
git config user.name "Mona Lisa"
- Replace _email@example.com with the email matching your Github profile
- Replace Mona Lisa with the name matching your Github profile
git config --global
will change all repositories
git clone https://github.com/user/repo
- Replace user with your username
- Replace repo with the name of the repository forked
git checkout -b branch-name
- Replace branch-name with a meaningful name for your work
-
Using your favorite editor, modify your source code
-
Verify that you made the changes you intended
git diff
git add .
git commit -s -m "description of changes made"
- The
-s
option will sign the commit, which is required by all Hyperledger repositories - Change
description of changes made
to a short description of the changes you made. Make sure you follow the requirements specified by the project's CONTRIBUTING guide
Check to see if you already have an upstream
remote
git remote -v
origin https://github.com/tkuhrt/hyperledgerwp (fetch)
origin https://github.com/tkuhrt/hyperledgerwp (push)
upstream https://github.com/hyperledger/hyperledgerwp.git (fetch)
upstream https://github.com/hyperledger/hyperledgerwp.git (push)
If you do not already have an upstream remote, create one using
git remote add upstream https://github.com/hyperledger/repo
- Replace repo with the name of the repository forked
Fetch from the upstream remote
git fetch upstream
git rebase -i upstream/master
Resolve any merge conflicts
git push origin branch-name
- Replace branch-name with name of branch where you made your changes
Create a new pull request by visiting https://github.com/user/repo
and clicking on the new pull request button
- Replace user with your username
- Replace repo with the name of the repository forked
Verify that the pull request contains your commits and that all commits are signed off
If you only have one commit, you can modify that commit using the --amend
command-line option
git commit --amend -s
If you have multiple commits, it is best to squash your commits into a single commit and signoff that single commit
git rebase -i upstream/master
Change the pick
entries for your changes to squash
or fixup