You will need to be an Apache Edgent committer to follow these steps. If you are not a committer, please contribute changes to the web siteopen a pull request with your changes, and a committer will commit your changes.
Prerequisites
- Git
- Jekyll
- Open pull request on GitHub
Set up a clone (one time)
- Run these commands one time to create a clone to use just for merging
...
The process differs slightly for merging source code vs. website pull requests.
Source code
Create a clone to be used specifically for merging PRs (this only needs to be setup one time)
Code Block language bash
...
git clone https://git-wip-us.apache.org/repos/asf/incubator-
...
edgent.git
...
clone-incubator-
...
edgent cd
...
clone-incubator-
...
edgent git remote add mirror https://github.com/apache/incubator-
...
edgent.git
Commit to the website
Run the following commands to merge an open PR. Replace XX with the PR number shown in GitHub.
Code Block language
...
bash cd clone-incubator-edgent git checkout
...
- Update master
Code Block | ||
---|---|---|
| ||
git pull origin master |
- Switch to the asf-site branch
Code Block | ||
---|---|---|
| ||
git checkout asf-site |
master # Switch to master git pull origin master # Update master git fetch mirror pull/XX/head:pr-XX # Fetch the changes from the pull request. This creates a new local branch pr-XX. git merge pr-XX # Update master with the PR's changes git push origin master # Push updated master to Apache Git repo git branch -d pr-XX # pr-XX is only a temp branch, no need to push to origin (ASF)
Website
Create a clone to be used specifically for merging PRs (this only needs to be setup one time)
Code Block language bash git clone https://git-wip-us.apache.org/repos/asf/incubator-edgent-website.git clone-incubator-edgent-website cd clone-incubator-edgent-website git remote add mirror https://github.com/apache/incubator-edgent-website.git
Run the following commands to merge an open PR. Replace XX with the PR number shown in GitHub.
Code Block language bash cd clone-incubator-edgent-website git checkout master # Switch to master git pull origin master # Update master git checkout asf-site
...
# Switch to asf-site
...
git
...
pull
...
origin asf-site
...
...
...
...
#
...
Update asf-site
...
Code Block | ||
---|---|---|
| ||
git pull origin asf-site |
- Switch back to the master branch
Code Block | ||
---|---|---|
| ||
git checkout master |
- Fetch the changes from the pull request
Note: XX is the pull request number from GitHub
...
language | text |
---|
git checkout master # Switch to master git fetch mirror pull/XX/head:pr-XX
...
- Check the changes in your local environment
- Update master with the pull request's changes
- Note: XX is the pull request number from GitHub
...
language | text |
---|
# Fetch the changes from the pull request. This creates a new local branch pr-XX. git merge pr-XX
...
- Remove the fetched PR branch (this is only a temporary branch)
Code Block | ||
---|---|---|
| ||
git branch -d pr-XX |
- Push updated master to the Apache Git repo
Code Block | ||
---|---|---|
| ||
git push origin master |
- Generate the html files, switch to asf-site, and update it
- Note: Make sure you are on the master branch before running this script
Code Block | ||
---|---|---|
| ||
sh build.sh |
- Push updated content. The website should be updated after this final step.
...
language | text |
---|
# Update master with the PR's changes git push origin master # Push updated master to the Apache Git repo sh build.sh # Generate the HTML files, switch to asf-site, and update it (make sure you're on master when running) git push origin asf-site
...
All Steps
...
language | text |
---|
...
# Push updated asf-site to the Apache Git repo git checkout master # Switch to master git
...
branch
...
-d pr-XX # pr-XX
...
is
...
only
...
a temp branch, no need to push to origin (ASF)
Note: The first time you commit, you may need to manually create a local copy of the asf-site branch.
Code Block | ||
---|---|---|
| ||
git checkout origin/asf-site # Switch to asf-site
git checkout -b asf-site # Create an asf-site branch |
<dlaboss: I don't recall ever having to switch to the asf-site branch or create a new local one. Are these two steps really needed?>
<kathssaunders: I had trouble today and Will helped me out. We had to do this. Can you edit these steps with something you think works, and I will try that next time? Just trying to get a set of repeatable steps that work–I've only done this twice so far>
<dlaboss: everything is now the same except those asf-site branch related things. While I've done the following many times, I haven't in a while and I'm willing to believe it might not handle a case where someone else has since done this such that my clone's asf-site branch isn't up to date. Here's what I've always done (what my script does):
cd asfclone-incubator-quarks-website
git checkout master
git pull
git fetch mirror pull/XX/head:pr-XX
git merge -m "Merge pull request #XX" -m "This closes #XX" pr-XX
git branch -d pr-XX
git push origin master
# then the build/push you have at the end though last I did it build.sh wasn't executable so instead "sh build.sh"
...