We definitely appreciate contributions in any form — QA, submitting issues, providing feedback, code, design, etc.
If you're part of the Liferay team in Figma, there's a Liferay.Design project — you can see where we're at and contribute comments, designs, etc there.
If you'd like to help manage deployments, please request to join our Netlify team!
A good place to start is our Issues page!
- Fork the repo.
- Clone your fork on your computer (local).
- Commit any changes to your local, then push to your origin.
- Create a pull request to upstream.
(If "local", "origin", and "upstream" are greek to you, see this top answer on Stack Overflow.)
Important Notes
-
All work should be done on the
master
branch (or you can create your own branch and request to merge it with themaster
branch. -
We always
Rebase & Merge
pull requests so that the commit history is kept as clean as possible — to that end, be sure to follow the best practices outlined below to avoid merge conflicts in your PRs.
If you don't have a pull-request in review, so that you are using the freshest code, pull the latest from upstream:
git pull upstream master
If you're prompted to do a merge commit (you probably will be), hit :wq
to close the merge comment, and then do a hard reset so that your local matches what is upstream:
git reset --hard upstream/master
Continue to push your commits up to your origin — they will automatically get added to your open pull-request.
Be sure to follow step #1 — pull fresh from upstream and do a hard reset (shortcut: git pull upstream master && git reset --hard upstream/master
) — this ensures that your next pull-request will only include new commits.
If you don't pull from upstream after your PR gets merged; you will get errors because the commit hashes change one they are merged into upstream.
If you have write
permissions to the repo, once you ensure the site works using Netlify's deploy previews, you can push to production.
- Ensure what you have locally is even with what is on upstream/master:
git pull upstream master && git reset --hard upstream/master
- Rename your local
master
branch toproduction
:git branch -m production
- Use the force, and push your local
production
branch to upstream:git push upstream production --force
That's it! In 2-4 minutes, the site will be built, deployed, and all updates will be reflected live on liferay.design.
This can happen for a myriad of reasons — but essentially it boils down to your local repo not being in-line with what is upstream. This is usually because:
-
Someone else's work was merged before you had a chance to send a PR.
-
You sent a PR, it was merged, but you didn't pull and reset your local repo to match upstream.
Don't worry — it's no big deal. There are two quick ways to solve it:
If you have a lot of commits, or enough code that it would be a pain to copy/paste — stashing and then cherry picking your work is a good idea.
- Create a temporary branch: (
git checkout -b temp-branch
) - Pull & reset to match upstream (
git pull upstream master && git reset --hard upstream/master
) - From the temp-branch, check the log to see which commits you want to cherry pick (
git log
) - Go back to the master branch (which is even with upstream since you reset it in step 2) and pick the commits you want (
git cherry-pick commit-sha
) Note: 'commit-sha' being what you see in step 3
Note: See Atlassian's 'Git Cherry Pick' tutorial for a more in-depth explanation on picking cherries.
If option 1 sounds like way too much work — or if you tried it and it didn't work — then you can always:
ctrl+c
your work- Pull & reset to match upstream (
git pull upstream master && git reset --hard upstream/master
) ctrl+v
A few aliases that will make your life easier. If you think 'Alias' is just an overrated Jennifer Garner show, check out this blog post for more information and kick your workflow into hyperspeed.
Use this after your PR is merged or if you haven't done any recent development on the site.
alias gstart="git pull upstream master && git reset --hard upstream/master"
alias pushprod="git branch -m production && git push upstream production --force"
alias reset="git branch -m master && git pull upstream master && git reset --hard upstream/master"
Try this first if you run into any errors when trying to start local development:
alias reinstall="rm -rf node_modules && npm install"
rm -rf node_modules
will delete your node_modules
folder, and npm install
will install everything. This will fix 96% of the errors you encounter.