Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 2.43 KB

git_basics.md

File metadata and controls

73 lines (48 loc) · 2.43 KB

Git basics

Instalation

macOS

On macOS it's usually more convenient to use brew than download files from the web.

brew install git

If you don't have brew, We highly recommend to install it.

Linux

Use your package manager, e.g. apt-get install git

Windows

Download Git from the official page: https://git-scm.com/download/win

How to start your work in the course

  1. Go to the project repository you want to work on, e.g. https://github.com/msd-code-academy/lessons and fork the repository

  2. Clone your newly created repository:

    git clone <url-of-your-repo>

    Copypasting url from browser is enough.

  3. Create new branch

    Don't push changes directly to the master, instead use branches so we can do Code Review with pull requests

    git checkout -b <some-name-for-your-branch>
  4. Commit & push your changes

    git add *
    git commit -m 'New cool stuff added'
    git push
  5. Create pull request

    • Go back to your Github repository
    • Click on "New pull request"
    • Select your branch in second dropdown you want to merge
    • You can use "Reviewers" in right panel to assign someone, e.g. some lectors, to review your changes

Tip: Use ssh keys instead of username/password:

  • Go to github.com/settings/keys or by clicking on your icon in righ top panel > settings > SSH and GPG keys
  • Click on new SSH key and provide the ssh key (usually located in ~/.ssh/id_rsa.pub), the title doesn't matter, it's just info for you
  • See Github help if you need advice

Useful resources