Skip to content

Latest commit

 

History

History
139 lines (91 loc) · 3.32 KB

github.md

File metadata and controls

139 lines (91 loc) · 3.32 KB

Fork the Repo

From the Github interface, click on the fork button fork

Fork the Repo - Choose Location

location

Ensure Git environment variables match your Github profile

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

Update Git environment variables

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

Clone the Repo

git clone https://github.com/user/repo
  • Replace user with your username
  • Replace repo with the name of the repository forked

Create a branch for your work

git checkout -b branch-name
  • Replace branch-name with a meaningful name for your work

Modify Source Code

  • Using your favorite editor, modify your source code

  • Verify that you made the changes you intended

    git diff

Commit Source Code

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

Retrieve latest changes from upstream

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)

Retrieve latest changes from upstream

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

Retrieve latest changes from upstream

Fetch from the upstream remote

git fetch upstream
git rebase -i upstream/master

Resolve any merge conflicts

Push changes to user's Github

git push origin branch-name
  • Replace branch-name with name of branch where you made your changes

Create a Pull Request

Create a new pull request by visiting https://github.com/user/repo and clicking on the new pull request button

new pull request button

  • Replace user with your username
  • Replace repo with the name of the repository forked

Create a Pull Request - Verify Changes

Verify that the pull request contains your commits and that all commits are signed off

Forgot to sign off

If you only have one commit, you can modify that commit using the --amend command-line option

git commit --amend -s

Forgot to sign off

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