Skip to content

util: moving repos in #195

@tunnckoCore

Description

@tunnckoCore
/**
 * 1. git remote add <project-name> <project-repo>
 * 2. git fetch <project-name>
 * 3. git checkout -b <project-name> <project-name/master>
 * 4. make a folder move all files to that subfolder, so no merge conflicts
 *   - use something like  `mv $(command ls -A) subfolder`
 *   - it includes all files and folders, including the dot ones
 *   - ignore the warning it cannot move subfolder into itself, it's OK
 * 5. git commit -m "chore: move <project-name> into the monorepo"
 *
 * Follow the following, OR create a PR
 *
 * 6. git checkout master
 * 7. git merge <project-name>
 * 8. git push
 * 9. cleanup
 *   - git remote rm <project-name>
 *   - git branch -d <project-name>
 */

and useful function for moving everything into a subfolder

# Also creates the folder name you passed, if it doesn't exist
# ignore the warnings, it does the correct job
moveAllTo() {
  if [ ! -d "$(pwd)/$1" ]; then
    mkdir -p "$(pwd)/$1"
  fi

  mv $(command ls -A) $1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions