Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: moving repos in #195

Open
tunnckoCore opened this issue Jun 20, 2022 · 0 comments
Open

util: moving repos in #195

tunnckoCore opened this issue Jun 20, 2022 · 0 comments

Comments

@tunnckoCore
Copy link
Owner

tunnckoCore commented Jun 20, 2022

/**
 * 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant