Sharedexamples-update-notes.mdOpen in CoCalc

howto switch back and forth between "src/examples" being a git submodule

key idea: always delete src/examples prior to any checkout or merge operation!

  1. stop webpack

  2. go into src directory: cd $SMC_ROOT

  3. check these assumptions

  • you're on the master branch and in sync with upstream
  • origin is the name of the remote github repo (otherwise, you might call it upstream? then rename origin below to upstream)
  • git status is clean
  1. switch to the examples-update branch

    rm -rf examples/
    git fetch origin
    git checkout -b examples-update origin/examples-update
    git submodule update --init
    env OUTDIR=../webapp-lib/examples make -C examples/
    
  2. (optional) in case you want to merge with origin/master again

    rm -rf examples/
    git merge origin/master
    
  3. start webpack again

  4. when done and going back to master:

    1. stop webpack
    2. rm -rf examples
    3. git checkout master ← will restore src/examples as a normal directory