Skip to content

Instantly share code, notes, and snippets.

@alterebro
Last active May 16, 2017 14:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alterebro/d621918642a5156652cf567836b81878 to your computer and use it in GitHub Desktop.
Save alterebro/d621918642a5156652cf567836b81878 to your computer and use it in GitHub Desktop.

GitHub Collaboration Workflow

Taken from : https://code.tutsplus.com/tutorials/how-to-collaborate-on-github--net-34267

  1. Forking Fork the repo on GitHub.com

  2. Cloning Clone the repo using the URL in the right sidebar:

git clone git@github.com:jcutrell/jquery.git
  1. Adding the Upstream Remote Change into the cloned directory and then at this point, you can add the upstream remote:
cd jquery
git remote add upstream git@github.com:jquery/jquery.git

This will now allow you to pull in changes from the source locally and merge them, like so:

git fetch upstream
git merge upstream/master
  1. Checking Out a Topic Branch However, before you make your own changes, checkout a topic branch:
git checkout -b enhancement_345
  1. Committing Now, you can make your changes, and create a commit that tracks just those changes.
git commit -am "adding a smileyface to the documentation."
  1. Pushing Next, you'll push this topic branch to your own fork of the project.
git push origin enhancment_345
  1. Creating a Pull Request Finally, you will create a pull request. First, go to your fork of the repo. You might see a "your recently pushed branches", and if so, you can choose "Compare and Pull Request". Otherwise, you can select your branch from the dropdown, and subsequently click "Pull Request" or "Compare" at the top right of the repo section.

Fork Sync

$ git remote -v # prints remotes fetch/push URLs

$ git fetch upstream
$ git checkout master # goto master branch
$ git merge upstream/master 

# ...
# ( $ git pull upstream master )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment