Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 2.66 KB

GITHUB-INTRO.md

File metadata and controls

69 lines (57 loc) · 2.66 KB

GitHub basics

In order to contribute to this project you need to be registered on GitHub.

Configure your local git client

GitHub matches individual commits and users using their email. To ensure a proper matching you should configure your local git client to use the email used to register on GitHub:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global pull.rebase true

This also enables the rebase option for the pull command by default to get a clean order of commits in branches.

We highly recommend to setup a SSH key to simplify the authentication with the GitHub server (Profile > Settings > SSH and GPG keys > New SSH key).

Configure a new project

  1. Fork the project
  2. Clone your fork
  3. Set up remotes

Fork the project

The first step is to fork the project (click the Fork button on the project site). A fork is your own copy of the repository that is stored server-side.

Clone the forked project

Afterwards you can clone your fork to create a local working copy:

$ git clone https://github.com/YOUR_USERNAME/PROJECT.git
$ git clone git@github.com:YOUR_USERNAME/PROJECT.git  # With SSH key

Set up remotes

The local git client is able to communicate with different remote repositories (remotes). It is convention to name the remote pointing to your fork origin (git clone does that by default) and the remote pointing to the original project repository upstream.

You can add the project URL to your local repository to be able to pull changes from it:

$ git remote add upstream https://github.com/atmtools/PROJECT.git

List all remotes to check the configuration of your git client:

$ git remote -v
origin https://github.com/YOUR_USERNAME/PROJECT.git (fetch)
origin https://github.com/YOUR_USERNAME/PROJECT.git (push)
upstream https://github.com/atmtools/PROJECT.git (fetch)
upstream https://github.com/atmtools/PROJECT.git (push)