Skip to content

Shifting between branches

Shaunak Das edited this page Dec 16, 2017 · 8 revisions

expo to integrated

Copying contents

  • copy /pure folder contents to ../pure_backup
  • copy db.json and App.js to ../other_backup
  • shift to integrated branch
git checkout integrated
  • Make a branch integrated_sync_DDMMM
git checkout -b integrated_sync_15Dec
  • Compare differences between /pure and ../pure_backup folder
cd .. && diff -rq genius_app/pure pure_backup

Ignore differences related App.js and App.test.js

  • Delete everything from /pure except App.js and App.test.js and copy from ../pure_backup folder into /pure
  • Delete App.js & db.json and copy from ../other_backup folder into /pure
  • Comment all expo related code
//pure/common/constants
export const ENVIRONMENT = 'integrated';
//Comment following line in pure/newpages/SplashPage.js
import { Font, Asset } from 'expo';

Installing and starting android build

  • Install npm packages
npm install
//If above command doesn't run
watchman watch-del-all
rm -rf node_modules && npm install
npm start -- --reset-cache
  • Start js server
npm start
  • Create the build from another tab
react-native run-android --appFolder /Users/shaunakdas2020/Documents/workspace/react_native_projects/genius_app/android/

Delete expo_* branches

  • Merging latest code into expo branch
git checkout expo
git pull origin expo
// Pull from latest expo branch
git pull origin expo_*
git status
git push origin expo
  • Deleting useless branches
//This command is needed to list all useless branches. Look out for expo_*
git branch
//For each expo_* branches run the following command
git branch -D expo_*
  • Delete all these branches from remote

integrated to expo

Copying contents

  • copy /pure folder contents to ../pure_backup
  • copy db.json and App.js to ../other_backup
  • shift to expo branch
git checkout expo
  • Make a branch expo_sync_DDMMM
git checkout -b expo_sync_15Dec
  • Compare differences between /pure and ../pure_backup folder
cd .. && diff -rq genius_app/pure pure_backup

Ignore differences related App.js and App.test.js

  • Delete everything from /pure except App.js and App.test.js and copy from ../pure_backup folder into /pure
  • Delete App.js & db.json and copy from ../other_backup folder into /pure
  • Comment all expo related code
//pure/common/constants
export const ENVIRONMENT = 'expo';
//Uncomment following line in pure/newpages/SplashPage.js
//import { Font, Asset } from 'expo';

Installing and starting android build

  • Install npm packages
npm install
//If above command doesn't run
watchman watch-del-all
rm -rf node_modules && npm install
npm start -- --reset-cache
  • Start js server
npm start

Delete integrated_* branches

  • Merging latest code into expo branch
git checkout integrated
git pull origin integrated
// Pull from latest expo branch
git pull origin integrated_*
git status
git push origin integrated
  • Deleting useless branches
//This command is needed to list all useless branches. Look out for integrated_*
git branch
//For each integrated_* branches run the following command
git branch -D integrated_*
  • Delete all these branches from remote

Post Install db.json server

  • Start mock json server
json-server --watch db.json
  • Start ngrok tunnel
~/Downloads/./nrok http 3000

Clone this wiki locally