-
Notifications
You must be signed in to change notification settings - Fork 3
Collaborating with Liquid Carrot
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]
π‘ 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 andupstream
refers to the original repository itself.
The pull request flow
Steps to follow:
-
Move to your master branch
git checkout master
-
Grab new changes from upstream
git pull upstream
-
Fix merge conflicts (if any)
-
Add changes & push to your fork
git push origin
-
Open a pull request
* | π Learn more | * |
---|---|---|
- | π Writing good commit messages | - |
π‘ 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
-
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
-
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 -
Make the changes that you want
content to append totally different content to merge later
The new merge.txt
-
Commit the results
git commit -m "merged and resolved the conflict in merge.txt"
* | π Learn more | * |
---|---|---|
- | π Writing good commit messages | - |
π‘ 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
π‘ 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