Menu

Make a Pull Request on Github

February 8, 2017 - git

Note: you need to have ssh key associated with github.
Look into ssh post and check ssh keys on https://github.com/settings/keys

Fork the original project on GitHub

Click on Fork icon in the header of any repository on GitHub.

GitHub fork icon in the header

Create a local copy

Copy the link from your forked repository.
git link

And enter into console:

git clone your-fork.git

Make the original repository a remote repo

Making original repository a remote repo is important so that you will be able to have the latest version of any changes that happened there since you forked the repository.

git remote add upstream git@________.git
git fetch upstream
git branch --set-upstream-to=upstream/master master

Create branch

Every time you create a new project start a new branch so that it is easier to see which files were changed in the process and that your code is separate from any other changes.

git checkout -b name_of_the_branch

Make changes in code and commit, push to repo

When you create new files, change existing ones and work on your project, make sure you commit updates and sync your branch with your repository on GitHub.

git add filename
git commit -m "Message for commit"
git push -u origin name_of_the_branch

-u was added to last command so we can push next time with only git push

Now go to GitHub and Submit request (Green button on local repo)

Example locations of repos:

base fork: ivandoric/olympus
base: master

head fork: 22nds/olympos
compare: functions_sidebar_ids

All done. Now cross your fingers that pull request will be merged to the original repo.