Skip to content

Collaborating with Liquid Carrot

Christian Echevarria edited this page Jun 11, 2019 · 50 revisions

Hello prospective carrot! πŸ‘‹

Thanks for considering collaborating with us in making Carrot the best JavaScript library for AI in the world 🌍

To help you get started we've curated a list of guides and steps to follow. Please take some time to read them and feel free to reach out with any questions you might have: [email protected]

Keeping changes synced with upstream

πŸ’‘ Why it's useful

If you add changes without syncing from upstream first you run into the risk of having conflicting changes with other contributors! Once you make changes, you usually want to send them back "upstream" to the official repository so that everyone pulling from it is working with the same code.

πŸ“Œ More info

Your local repository has a reference to origin i.e. your fork of the original code on GitHub and upstream refers to the original repository itself.

The pull-request flow

The pull request flow


Steps to follow:

  1. Move to your master branch

    git checkout master

  2. Grab new changes from upstream

    git pull upstream

  3. Fix merge conflicts (if any)

    ⬇️ How to solve merge conflicts

  4. Add changes & push to your fork

    git push origin

  5. Open a pull request

    ⬇️ How to open a pull-request

* πŸŽ“ Learn more *
- πŸ“œ Writing good commit messages -

How to solve a merge conflict

πŸ’‘ Why it's useful

Merging and conflicts are a common part of the Git experience. Conflicts generally arise when two people have changed the same lines in a file, or if one developer deleted a file while another developer was modifying it. source

πŸ“Œ More info

Conflicts only affect the developer conducting the merge, the rest of the team is unaware of the conflict. Git will mark the file as being conflicted and halt the merging process. source

  1. When a merge conflict happens your terminal will display something like this:

    $ git status
    On branch master
    You have unmerged paths.
    (fix conflicts and run "git commit")
    (use "git merge --abort" to abort the merge)
    
    Unmerged paths:
    (use "git add <file>..." to mark resolution)
    
    both modified:   merge.txt
    
  2. To resolve it manually, enter the files listed and find the areas that look like this:

    $ cat merge.txt
    <<<<<<< HEAD
    this is some content to mess with
    content to append
    =======
    totally different content to merge later
    >>>>>>> new_branch_to_merge_later
    

    πŸŽ“ You can think of the ======= line as the center of a conflict

  3. Make the changes that you want

    content to append
    totally different content to merge later
    

    The new merge.txt

  4. Commit the results

    git commit -m "merged and resolved the conflict in merge.txt"

* πŸŽ“ Learn more *
- πŸ“œ Writing good commit messages -

How to open a pull-request

πŸ’‘ Why it's useful

Pull requests get your changes into the official repository. Doing this often minimizes the risk of conflicting code and allows for feedback on your work!

πŸ“Œ More info

Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch. source

Make sure to allow edits from maintainers!

πŸ“œ Creating a Pull Request from a Fork

How to open a good issue

πŸ’‘ Why it's useful

GitHub issues are where discussions about the project happen. Getting good at writing GitHub issues will get you more help building your projects. source

πŸ“Œ More info

TBD

First, the mechanics of creating an issue

πŸ“œ Creating an Issue on GitHub

Then, guidelines for writing a good issue

πŸ“œ How We Write GitHub Issues