Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Create a clone to be used specifically for merging PRs (this only needs to be setup one time)

    Code Block
    languagebash

...

  1. git clone https://git-wip-us.apache.org/repos/asf/incubator-

...

  1. edgent.git 

...

  1. clone-incubator-

...

  1. edgent
    cd 

...

  1. clone-incubator-

...

  1. edgent
    git remote add mirror https://github.com/apache/incubator-

...

  1. edgent.git

Commit to the website

  1. Run the following commands to merge an open PR. Replace XX with the PR number shown in GitHub.

    Code Block
    language

...

  1. bash
    cd clone-incubator-edgent
    git checkout

...

  • Update master
Code Block
languagetext
git pull origin master
  • Switch to the asf-site branch
Code Block
languagetext
git checkout asf-site
  1.  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

  1. Create a clone to be used specifically for merging PRs (this only needs to be setup one time)

    Code Block
    languagebash
    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
  2. Run the following commands to merge an open PR. Replace XX with the PR number shown in GitHub.

    Code Block
    languagebash
    cd clone-incubator-edgent-website
    git checkout master                           # Switch to master
    git pull origin master                        # Update master
    git checkout asf-site                         

...

  1. # Switch to asf-site

...

  1. 
    git 

...

  1. pull 

...

  1. origin asf-site                 

...

  1.    

...

  1.  

...

  1.  

...

  1. # 

...

  1. Update asf-site

...

Code Block
languagetext
git pull origin asf-site
  • Switch back to the master branch
Code Block
languagetext
git checkout master
  • Fetch the changes from the pull request
    • Note: XX is the pull request number from GitHub

...

languagetext
  1. 
    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

...

languagetext
  1.            # 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
languagetext
git branch -d pr-XX
  • Push updated master to the Apache Git repo
Code Block
languagetext
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
languagetext
sh build.sh
  • Push updated content. The website should be updated after this final step.

...

languagetext
  1.                                # 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

...

languagetext

...

  1.                       # Push updated asf-site to the Apache Git repo
    git checkout master							  # Switch to master
    git 

...

  1. branch 

...

  1. -d pr-XX                           # pr-XX

...

  1.  is 

...

  1. only 

...

  1. 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
languagebash
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"

...