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 [email protected]
$ 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 [email protected]: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)