Skip to content

Latest commit

 

History

History
75 lines (64 loc) · 2.95 KB

GITHUB-INTRO.md

File metadata and controls

75 lines (64 loc) · 2.95 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

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
  4. Update your working copy

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

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)

Update your working copy

Make sure to pull changes from the upstream master branch at regular intervals to keep track of changes done to the project. We recommend to use the --rebase flag. This will rewind your commits and reapply them on top of the project's history to maintain a linear history.

$ git pull --rebase upstream master